]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Avoid running CXX11 Thread support test
authorMatthias Maier <tamiko@43-1.org>
Sun, 6 Sep 2015 06:04:52 +0000 (01:04 -0500)
committerMatthias Maier <tamiko@43-1.org>
Sun, 6 Sep 2015 08:05:10 +0000 (03:05 -0500)
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.

cmake/checks/check_01_cxx_features.cmake

index 1bfd26258596984391a1f5bc8c8af2ede97fdb22..f8775c5c23e6608869ec54b2f2a3c52e6d371e0d 100644 (file)
@@ -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 <thread>
-        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 <thread>
+      void f(int){}
+      int main(){ std::thread t(f,1); t.join(); return 0; }
+      "
+      DEAL_II_HAVE_CXX11_THREAD)
 
     CHECK_CXX_SOURCE_COMPILES(
       "

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.