Do not update CMAKE_REQUIRED_FLAGS to match CMAKE_CXX_FLAGS. - This was a hangover from the pre-Ceres 2.0 era when we needed to ensure that -std=c++11 was passed to check_cxx_source_compiles() in FindUnorderedMap/FindSharedPtr if the user had enabled CXX11. - Unfortunately, the same variable (CMAKE_REQUIRED_FLAGS) is used for both check_cxx_source_compiles() and check_c_source_compiles(), and thus updating it to include -std=c++11 would thus break any checks for C, which are made internally in the version of FindThreads.cmake shipped with CMake which could cause build breakage as identified in issue #355. Change-Id: I36be1a21db14e3839eaf955a80bd952ef40fa269
diff --git a/CMakeLists.txt b/CMakeLists.txt index efbce67..b02bf7a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -435,11 +435,6 @@ message("-- Building without OpenMP, disabling.") endif (OPENMP) -# Initialise CMAKE_REQUIRED_FLAGS used by CheckCXXSourceCompiles with the -# contents of CMAKE_CXX_FLAGS such that if the user has passed extra flags -# they are used when checking for compiler features. -set(CMAKE_REQUIRED_FLAGS ${CMAKE_CXX_FLAGS}) - if (TBB) find_package(TBB QUIET) if (TBB_FOUND)