From 58a2d519a82e668bd960f29977e3c9e17cabde66 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 18 Aug 2015 15:17:40 -0500 Subject: [PATCH] Provide a cached variable for the detection of FP exceptions. This way people can switch off the whole mechanism if the want. --- cmake/checks/check_02_system_features.cmake | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/cmake/checks/check_02_system_features.cmake b/cmake/checks/check_02_system_features.cmake index 33aaccc9f0..7f481b7e45 100644 --- a/cmake/checks/check_02_system_features.cmake +++ b/cmake/checks/check_02_system_features.cmake @@ -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() -- 2.39.5