summaryrefslogtreecommitdiff
path: root/build/cmake
diff options
context:
space:
mode:
authorJames E. King, III <jking@apache.org>2016-11-14 10:20:52 -0500
committerJames E. King, III <jking@apache.org>2016-11-14 10:20:52 -0500
commitc9877fb3b40b99c47ab634f15bc7d1cb0acb1053 (patch)
tree6417d10c32fb3001f855f0da5726a7e6c6b85c44 /build/cmake
parentc544975d910534b753dc1c4480c09042f8ba07af (diff)
downloadthrift-c9877fb3b40b99c47ab634f15bc7d1cb0acb1053.tar.gz
THRIFT-3937 if the compiler is too old (gcc before 4.8) disable new compiler plugin during configuration
Client: C++ This closes #1101
Diffstat (limited to 'build/cmake')
-rw-r--r--build/cmake/DefineOptions.cmake11
-rw-r--r--build/cmake/DefinePlatformSpecifc.cmake9
2 files changed, 15 insertions, 5 deletions
diff --git a/build/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake
index 171c9fefa..0c853b1ce 100644
--- a/build/cmake/DefineOptions.cmake
+++ b/build/cmake/DefineOptions.cmake
@@ -164,6 +164,7 @@ message(STATUS "Thrift package version: ${PACKAGE_VERSION}
message(STATUS "Build configuration Summary")
message(STATUS " Build Thrift compiler: ${BUILD_COMPILER}")
message(STATUS " Build compiler plugin support: ${WITH_PLUGIN}")
+MESSAGE_DEP(PLUGIN_COMPILER_NOT_TOO_OLD "Disabled due to older compiler")
message(STATUS " Build with unit tests: ${BUILD_TESTING}")
MESSAGE_DEP(HAVE_COMPILER "Disabled because BUILD_THRIFT=OFF and no valid THRIFT_COMPILER is given")
message(STATUS " Build examples: ${BUILD_EXAMPLES}")
@@ -171,13 +172,13 @@ MESSAGE_DEP(HAVE_COMPILER "Disabled because BUILD_THRIFT=OFF and no valid THRIFT
message(STATUS " Build Thrift libraries: ${BUILD_LIBRARIES}")
message(STATUS " Language libraries:")
message(STATUS " Build C++ library: ${BUILD_CPP}")
-MESSAGE_DEP(WITH_CPP "Disabled by via WITH_CPP=OFF")
+MESSAGE_DEP(WITH_CPP "Disabled by WITH_CPP=OFF")
MESSAGE_DEP(Boost_FOUND "Boost headers missing")
message(STATUS " Build C (GLib) library: ${BUILD_C_GLIB}")
-MESSAGE_DEP(WITH_C_GLIB "Disabled by via WITH_C_GLIB=OFF")
+MESSAGE_DEP(WITH_C_GLIB "Disabled by WITH_C_GLIB=OFF")
MESSAGE_DEP(GLIB_FOUND "GLib missing")
message(STATUS " Build Java library: ${BUILD_JAVA}")
-MESSAGE_DEP(WITH_JAVA "Disabled by via WITH_JAVA=OFF")
+MESSAGE_DEP(WITH_JAVA "Disabled by WITH_JAVA=OFF")
if(ANDROID)
MESSAGE_DEP(GRADLE_FOUND "Gradle missing")
else()
@@ -185,10 +186,10 @@ else()
MESSAGE_DEP(ANT_FOUND "Ant missing")
endif()
message(STATUS " Build Python library: ${BUILD_PYTHON}")
-MESSAGE_DEP(WITH_PYTHON "Disabled by via WITH_PYTHON=OFF")
+MESSAGE_DEP(WITH_PYTHON "Disabled by WITH_PYTHON=OFF")
MESSAGE_DEP(PYTHONLIBS_FOUND "Python libraries missing")
message(STATUS " Build Haskell library: ${BUILD_HASKELL}")
-MESSAGE_DEP(WITH_HASKELL "Disabled by via WITH_HASKELL=OFF")
+MESSAGE_DEP(WITH_HASKELL "Disabled by WITH_HASKELL=OFF")
MESSAGE_DEP(GHC_FOUND "GHC missing")
MESSAGE_DEP(CABAL_FOUND "Cabal missing")
message(STATUS " Library features:")
diff --git a/build/cmake/DefinePlatformSpecifc.cmake b/build/cmake/DefinePlatformSpecifc.cmake
index 01fcd378a..e57ecc2f9 100644
--- a/build/cmake/DefinePlatformSpecifc.cmake
+++ b/build/cmake/DefinePlatformSpecifc.cmake
@@ -95,3 +95,12 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O2 -Wall -Wextra")
endif()
endif()
+
+# If gcc older than 4.8 is detected, disable new compiler plug-in support (see THRIFT-3937)
+set(PLUGIN_COMPILER_NOT_TOO_OLD ON) # simplifies messaging in DefineOptions summary
+if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8" AND WITH_PLUGIN)
+ message(STATUS "Disabling compiler plug-in support to work with older gcc compiler")
+ set(WITH_PLUGIN OFF)
+ set(PLUGIN_COMPILER_NOT_TOO_OLD OFF)
+endif()
+