summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorMarco Molteni <marco.molteni@laposte.net>2015-04-16 13:50:20 +0200
committerRoger Meier <roger@apache.org>2015-04-16 22:23:27 +0200
commit83494259d1ee7657b90bf8f2c234a3133cde8fa9 (patch)
tree23f87eb3239ebee9431e5b1224999ba6aaa22d59 /build
parent3b61971c8e8401e09919b3fb40b8e42bd27f9c71 (diff)
downloadthrift-83494259d1ee7657b90bf8f2c234a3133cde8fa9.tar.gz
THRIFT-3099 cmake build is broken on FreeBSD
Diffstat (limited to 'build')
-rw-r--r--build/cmake/DefineOptions.cmake2
-rw-r--r--build/cmake/DefinePlatformSpecifc.cmake12
2 files changed, 10 insertions, 4 deletions
diff --git a/build/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake
index 7d8b032ae..a8b40c243 100644
--- a/build/cmake/DefineOptions.cmake
+++ b/build/cmake/DefineOptions.cmake
@@ -39,7 +39,7 @@ CMAKE_DEPENDENT_OPTION(WITH_CPP "Build C++ library" ON
"BUILD_LIBRARIES;Boost_FOUND" OFF)
# NOTE: Currently the following options are C++ specific,
# but in future other libraries might reuse them.
-# So they are not dependent on WIHT_CPP but setting them without WITH_CPP currently
+# So they are not dependent on WITH_CPP but setting them without WITH_CPP currently
# has no effect.
find_package(ZLIB QUIET)
CMAKE_DEPENDENT_OPTION(WITH_ZLIB "Build with ZLIB support" ON
diff --git a/build/cmake/DefinePlatformSpecifc.cmake b/build/cmake/DefinePlatformSpecifc.cmake
index bafbf49e0..63e78f4f9 100644
--- a/build/cmake/DefinePlatformSpecifc.cmake
+++ b/build/cmake/DefinePlatformSpecifc.cmake
@@ -68,8 +68,14 @@ elseif(UNIX)
endif()
-# GCC Specific
-if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
- # TODO: -pedantic can not be used at the moment because of: https://issues.apache.org/jira/browse/THRIFT-2784
+# GCC and Clang.
+if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ # FIXME -pedantic can not be used at the moment because of: https://issues.apache.org/jira/browse/THRIFT-2784
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O2 -Wall -Wextra -pedantic")
+ # FIXME enabling c++11 breaks some Linux builds on Travis by triggering a g++ bug, see
+ # https://travis-ci.org/apache/thrift/jobs/58017022
+ # on the other hand, both MacOSX and FreeBSD need c++11
+ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O2 -Wall -Wextra")
+ endif()
endif()