You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2019/10/20 14:22:36 UTC

[thrift] 01/02: THRIFT-4938 Issues with version.h treatment Client: Compiler Patch: Jens Geyer

This is an automated email from the ASF dual-hosted git repository.

jensg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git

commit 7199741f440ef7de15e13755ea2371157c8cd298
Author: Jens Geyer <je...@apache.org>
AuthorDate: Sat Oct 19 21:22:59 2019 +0200

    THRIFT-4938 Issues with version.h treatment
    Client: Compiler
    Patch: Jens Geyer
    
    This closes #1902
---
 build/veralign.sh                                   | 1 +
 compiler/cpp/CMakeLists.txt                         | 5 +++--
 compiler/cpp/Makefile.am                            | 5 +++--
 compiler/cpp/src/thrift/{version.h.in => version.h} | 2 +-
 compiler/cpp/tests/CMakeLists.txt                   | 5 +++--
 configure.ac                                        | 1 -
 6 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/build/veralign.sh b/build/veralign.sh
index ffecb6e..39b67eb 100755
--- a/build/veralign.sh
+++ b/build/veralign.sh
@@ -54,6 +54,7 @@ FILES[Thrift.podspec]=simpleReplace
 FILES[appveyor.yml]=simpleReplace
 FILES[bower.json]=jsonReplace
 FILES[configure.ac]=configureReplace
+FILES[compiler/cpp/src/thrift/version.h]=simpleReplace
 FILES[contrib/thrift.spec]=simpleReplace
 FILES[doc/specs/idl.md]=simpleReplace
 FILES[lib/as3/gradle.properties]=simpleReplace
diff --git a/compiler/cpp/CMakeLists.txt b/compiler/cpp/CMakeLists.txt
index 17dae47..2bc08cf 100644
--- a/compiler/cpp/CMakeLists.txt
+++ b/compiler/cpp/CMakeLists.txt
@@ -20,7 +20,8 @@
 cmake_minimum_required(VERSION 3.3)
 project("thrift-compiler" VERSION ${PACKAGE_VERSION})
 
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/thrift/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/thrift/version.h)
+# version.h now handled via veralign.sh
+#configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/thrift/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/thrift/version.h)
 
 find_package(FLEX REQUIRED)
 find_package(BISON REQUIRED)
@@ -47,7 +48,7 @@ set(compiler_core
     src/thrift/generate/t_generator.cc
     src/thrift/parse/t_typedef.cc
     src/thrift/parse/parse.cc
-    ${CMAKE_CURRENT_BINARY_DIR}/thrift/version.h
+    src/thrift/version.h
 )
 
 set(thrift-compiler_SOURCES
diff --git a/compiler/cpp/Makefile.am b/compiler/cpp/Makefile.am
index 91801c6..429df64 100644
--- a/compiler/cpp/Makefile.am
+++ b/compiler/cpp/Makefile.am
@@ -45,6 +45,7 @@ thrift_SOURCES = src/thrift/audit/t_audit.cpp \
                  src/thrift/logging.h \
                  src/thrift/main.cc \
                  src/thrift/main.h \
+                 src/thrift/version.h \
                  src/thrift/parse/parse.cc \
                  src/thrift/parse/t_base_type.h \
                  src/thrift/parse/t_const.h \
@@ -118,8 +119,8 @@ EXTRA_DIST = \
              test \
              $(WINDOWS_DIST)
 
-clean-local:
-	$(RM) version.h
+#clean-local:
+#	$(RM) version.h   -- do not delete, we need it
 
 src/thrift/main.cc: src/thrift/version.h
 
diff --git a/compiler/cpp/src/thrift/version.h.in b/compiler/cpp/src/thrift/version.h
similarity index 95%
rename from compiler/cpp/src/thrift/version.h.in
rename to compiler/cpp/src/thrift/version.h
index aef076f..3a7250d 100644
--- a/compiler/cpp/src/thrift/version.h.in
+++ b/compiler/cpp/src/thrift/version.h
@@ -24,6 +24,6 @@
 #pragma once
 #endif // _MSC_VER
 
-#define THRIFT_VERSION "@PACKAGE_VERSION@"
+#define THRIFT_VERSION "0.14.0"
 
 #endif // _THRIFT_VERSION_H_
diff --git a/compiler/cpp/tests/CMakeLists.txt b/compiler/cpp/tests/CMakeLists.txt
index fde9073..91cc35d 100644
--- a/compiler/cpp/tests/CMakeLists.txt
+++ b/compiler/cpp/tests/CMakeLists.txt
@@ -27,7 +27,8 @@ set(THRIFT_COMPILER_SOURCE_DIR
 # don't generate ZERO_CHECK
 set(CMAKE_SUPPRESS_REGENERATION true)
 
-configure_file(${THRIFT_COMPILER_SOURCE_DIR}/src/thrift/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/thrift/version.h)
+# version.h now handled via veralign.sh
+#configure_file(${THRIFT_COMPILER_SOURCE_DIR}/src/thrift/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/thrift/version.h)
 if(MSVC)
     # The winflexbison generator outputs some macros that conflict with the Visual Studio 2010 copy of stdint.h
     # This might be fixed in later versions of Visual Studio, but an easy solution is to include stdint.h first
@@ -77,7 +78,7 @@ set(thrift_compiler_SOURCES
     ${THRIFT_COMPILER_SOURCE_DIR}/src/thrift/generate/t_generator.cc
     ${THRIFT_COMPILER_SOURCE_DIR}/src/thrift/parse/t_typedef.cc
     ${THRIFT_COMPILER_SOURCE_DIR}/src/thrift/parse/parse.cc
-    ${CMAKE_CURRENT_BINARY_DIR}/thrift/version.h
+    ${THRIFT_COMPILER_SOURCE_DIR}/thrift/version.h
 )
 
 # This macro adds an option THRIFT_COMPILER_${NAME}
diff --git a/configure.ac b/configure.ac
index 4892362..ad26ef0 100755
--- a/configure.ac
+++ b/configure.ac
@@ -791,7 +791,6 @@ AC_CONFIG_FILES([
   compiler/cpp/Makefile
   compiler/cpp/src/Makefile
   compiler/cpp/test/Makefile
-  compiler/cpp/src/thrift/version.h
   lib/Makefile
   lib/as3/Makefile
   lib/cl/Makefile