]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: cosmetic changes
authorMatthias Maier <tamiko@43-1.org>
Sun, 6 May 2018 16:39:55 +0000 (11:39 -0500)
committerMatthias Maier <tamiko@43-1.org>
Sun, 6 May 2018 17:19:11 +0000 (12:19 -0500)
cmake/checks/check_01_cxx_features.cmake

index ccc50ab2f3cadd8533131487a873f7816977b418..842bb034b861ed839ee8b1b416a6d87f54588491 100644 (file)
 #                                                                      #
 ########################################################################
 
+
+#
+#                              BIG DISCLAIMER
+#
+# Frankly speaking - this whole file is a mess and has to be rewritten and
+# restructured at some point. So, if you are the lucky one who wants to add
+# DEAL_II_WITH_CXX2X support, do not add yet another 300 lines of spaghetti
+# code but restructure the whole thing to something sane.
+#
+
+
 #
 IF(DEAL_II_WITH_CXX17 AND DEFINED DEAL_II_WITH_CXX14 AND NOT DEAL_II_WITH_CXX14)
   MESSAGE(FATAL_ERROR
@@ -459,6 +470,13 @@ ELSE()
     "DEAL_II_WITH_CXX17 and DEAL_II_WITH_CXX14 are both disabled")
 ENDIF()
 
+
+########################################################################
+#                                                                      #
+#                   Check for various C++ features:                    #
+#                                                                      #
+########################################################################
+
 #
 # Try to enable a fallthrough attribute. This is a language feature in C++17,
 # but a compiler extension in earlier language versions: check both
@@ -500,14 +518,8 @@ ELSE()
   ENDIF()
 ENDIF()
 
-
-########################################################################
-#                                                                      #
-#                   Check for various C++ features:                    #
-#                                                                      #
-########################################################################
-
 PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}")
+
 CHECK_CXX_SOURCE_COMPILES(
   "
   #include <type_traits>
@@ -515,7 +527,6 @@ CHECK_CXX_SOURCE_COMPILES(
   "
   DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE)
 
-
 #
 # Check that we can use feenableexcept through the C++11 header file cfenv:
 #
@@ -525,9 +536,7 @@ CHECK_CXX_SOURCE_COMPILES(
 #
 # - Timo Heister, 2015
 #
-
-IF(DEAL_II_ALLOW_PLATFORM_INTROSPECTION)
-  CHECK_CXX_SOURCE_RUNS(
+SET(_snippet
     "
     #include <cfenv>
     #include <limits>
@@ -544,30 +553,15 @@ IF(DEAL_II_ALLOW_PLATFORM_INTROSPECTION)
       return 0;
     }
     "
-    DEAL_II_HAVE_FP_EXCEPTIONS)
+    )
+IF(DEAL_II_ALLOW_PLATFORM_INTROSPECTION)
+  CHECK_CXX_SOURCE_RUNS("${_snippet}" DEAL_II_HAVE_FP_EXCEPTIONS)
 ELSE()
   #
   # If we are not allowed to do platform introspection, just test whether
   # we can compile above code.
   #
-  CHECK_CXX_SOURCE_COMPILES(
-    "
-    #include <cfenv>
-    #include <limits>
-    #include <sstream>
-
-    int main()
-    {
-      feenableexcept(FE_DIVBYZERO|FE_INVALID);
-      std::ostringstream description;
-      const double lower_bound = -std::numeric_limits<double>::max();
-
-      description << lower_bound;
-
-      return 0;
-    }
-    "
-    DEAL_II_HAVE_FP_EXCEPTIONS)
+  CHECK_CXX_SOURCE_COMPILES("${_snippet}" DEAL_II_HAVE_FP_EXCEPTIONS)
 ENDIF()
 
 #
@@ -593,4 +587,5 @@ CHECK_CXX_SOURCE_COMPILES(
   }
   "
   DEAL_II_HAVE_COMPLEX_OPERATOR_OVERLOADS)
+
 RESET_CMAKE_REQUIRED()

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.