]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Provide a cached variable for the detection of FP exceptions. 965/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 18 Aug 2015 20:17:40 +0000 (15:17 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 18 Aug 2015 20:17:40 +0000 (15:17 -0500)
This way people can switch off the whole mechanism if the want.

cmake/checks/check_02_system_features.cmake

index 33aaccc9f026c8dc7fbced3a3a8a4d2dea793827..7f481b7e451430b56984c95326dd12c49ecb6947 100644 (file)
@@ -95,11 +95,17 @@ CHECK_CXX_SOURCE_RUNS("
   " 
   _HAVE_FP_EXCEPTIONS)
 
-IF(_HAVE_FP_EXCEPTIONS)
-  MESSAGE(STATUS "Checking for Floating Point Exception macros -- Success")
-  SET(DEAL_II_HAVE_FP_EXCEPTIONS 1)
-ELSE()
-  MESSAGE(STATUS "Checking for Floating Point Exception macros -- Failed")
+
+SET(DEAL_II_HAVE_FP_EXCEPTIONS ON CACHE BOOL "If ON, floating point exception are raised in debug mode when running the testsuite.")
+
+IF (DEAL_II_HAVE_FP_EXCEPTIONS)
+  IF(_HAVE_FP_EXCEPTIONS)
+    MESSAGE(STATUS "Checking for Floating Point Exception macros -- Success")
+    # nothing to set here -- DEAL_II_HAVE_FP_EXCEPTIONS is already ON
+  ELSE()
+    MESSAGE(STATUS "Checking for Floating Point Exception macros -- Failed")
+    SET(DEAL_II_HAVE_FP_EXCEPTIONS OFF CACHE BOOL "" FORCE)
+  ENDIF()
 ENDIF()
 
 

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.