From: Matthias Maier Date: Mon, 7 Sep 2015 21:04:01 +0000 (-0500) Subject: CMake: Bugfix: Export -pthread when trying to link X-Git-Tag: v8.4.0-rc2~465^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1545%2Fhead;p=dealii.git CMake: Bugfix: Export -pthread when trying to link It turns out that clang is a bit more picky and wants to have -pthread on the command line. --- diff --git a/cmake/checks/check_01_cxx_features.cmake b/cmake/checks/check_01_cxx_features.cmake index f8775c5c23..3e39aed620 100644 --- a/cmake/checks/check_01_cxx_features.cmake +++ b/cmake/checks/check_01_cxx_features.cmake @@ -217,6 +217,7 @@ IF(NOT DEFINED DEAL_II_WITH_CXX11 OR DEAL_II_WITH_CXX11) " DEAL_II_HAVE_CXX11_SHARED_PTR) + PUSH_CMAKE_REQUIRED("-pthread") CHECK_CXX_SOURCE_COMPILES( " #include @@ -224,6 +225,8 @@ IF(NOT DEFINED DEAL_II_WITH_CXX11 OR DEAL_II_WITH_CXX11) int main(){ std::thread t(f,1); t.join(); return 0; } " DEAL_II_HAVE_CXX11_THREAD) + RESET_CMAKE_REQUIRED() + PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}") CHECK_CXX_SOURCE_COMPILES( "