From: Matthias Maier Date: Sun, 6 Sep 2015 06:04:52 +0000 (-0500) Subject: CMake: Avoid running CXX11 Thread support test X-Git-Tag: v8.4.0-rc2~472^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=344618a485276b376dfec521dcace25b8fde8ed7;p=dealii.git CMake: Avoid running CXX11 Thread support test We have had multiple problems with running this test so far. The latests is pull request #1524, the attempted fix opens another problem #1535. Given the fact that the test tries to detect a problem with gcc-4.5, just check for successful compilation. --- diff --git a/cmake/checks/check_01_cxx_features.cmake b/cmake/checks/check_01_cxx_features.cmake index 1bfd262585..f8775c5c23 100644 --- a/cmake/checks/check_01_cxx_features.cmake +++ b/cmake/checks/check_01_cxx_features.cmake @@ -217,32 +217,13 @@ IF(NOT DEFINED DEAL_II_WITH_CXX11 OR DEAL_II_WITH_CXX11) " DEAL_II_HAVE_CXX11_SHARED_PTR) - # - # On some systems with gcc 4.5.0, we can compile the code - # below but it will throw an exception when run. So test - # that as well. - # - IF(DEAL_II_ALLOW_PLATFORM_INTROSPECTION) - PUSH_CMAKE_REQUIRED("-pthread") - # - # On Ubuntu 14.04, the code below won't run without the flag - # -Wl,-no-as-needed. However, deal.II will work fine without - # the flag. - # - PUSH_CMAKE_REQUIRED("-Wl,-no-as-needed") - CHECK_CXX_SOURCE_RUNS( - " - #include - void f(int){} - 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}") - ELSE() - # Just export it ;-) - SET(DEAL_II_HAVE_CXX11_THREAD TRUE CACHE BOOL "") - ENDIF() + CHECK_CXX_SOURCE_COMPILES( + " + #include + void f(int){} + int main(){ std::thread t(f,1); t.join(); return 0; } + " + DEAL_II_HAVE_CXX11_THREAD) CHECK_CXX_SOURCE_COMPILES( "