Repository: thrift Updated Branches: refs/heads/master 932c3ee66 -> 1673adf94
THRIFT-3094 fix broken cmake build of C++ library with alternate threading Project: http://git-wip-us.apache.org/repos/asf/thrift/repo Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/1673adf9 Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/1673adf9 Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/1673adf9 Branch: refs/heads/master Commit: 1673adf94a381d66db2f0a062c636b24937473f7 Parents: 932c3ee Author: Jim King <[email protected]> Authored: Mon Apr 13 12:25:35 2015 -0400 Committer: Roger Meier <[email protected]> Committed: Mon Apr 13 21:05:53 2015 +0200 ---------------------------------------------------------------------- build/cmake/DefinePlatformSpecifc.cmake | 12 +++++++++++- lib/cpp/CMakeLists.txt | 2 -- 2 files changed, 11 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/thrift/blob/1673adf9/build/cmake/DefinePlatformSpecifc.cmake ---------------------------------------------------------------------- diff --git a/build/cmake/DefinePlatformSpecifc.cmake b/build/cmake/DefinePlatformSpecifc.cmake index 282cad3..bafbf49 100644 --- a/build/cmake/DefinePlatformSpecifc.cmake +++ b/build/cmake/DefinePlatformSpecifc.cmake @@ -56,7 +56,17 @@ if(MSVC) else(WITH_MT) set(STATIC_POSTFIX "md" CACHE STRING "Set static library postfix" FORCE) endif(WITH_MT) -endif(MSVC) + +elseif(UNIX) + # For UNIX + # WITH_*THREADS selects which threading library to use + if(WITH_BOOSTTHREADS) + add_definitions("-DUSE_BOOST_THREAD=1") + elseif(WITH_STDTHREADS) + add_definitions("-DUSE_STD_THREAD=1") + endif() + +endif() # GCC Specific if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) http://git-wip-us.apache.org/repos/asf/thrift/blob/1673adf9/lib/cpp/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/lib/cpp/CMakeLists.txt b/lib/cpp/CMakeLists.txt index 4c73986..9075c56 100755 --- a/lib/cpp/CMakeLists.txt +++ b/lib/cpp/CMakeLists.txt @@ -104,7 +104,6 @@ endif() # WITH_*THREADS selects which threading library to use if(WITH_BOOSTTHREADS) - add_definitions("-DUSE_BOOST_THREAD=1") set( thriftcpp_threads_SOURCES src/thrift/concurrency/BoostThreadFactory.cpp src/thrift/concurrency/BoostMonitor.cpp @@ -119,7 +118,6 @@ elseif(UNIX AND NOT WITH_STDTHREADS) src/thrift/concurrency/Monitor.cpp ) else() - add_definitions("-DUSE_STD_THREAD=1") if(UNIX) # need pthread for multi-thread support list(APPEND SYSLIBS pthread)
