]> https://gitweb.dealii.org/ - dealii.git/commitdiff
enable c++ standard library debug checks
authorTimo Heister <timo.heister@gmail.com>
Mon, 12 Aug 2024 20:26:25 +0000 (16:26 -0400)
committerTimo Heister <timo.heister@gmail.com>
Mon, 12 Aug 2024 20:31:23 +0000 (16:31 -0400)
cmake/setup_compiler_flags_gnu.cmake

index 263c57bc857d0e6d1e5a57656baf442b74de92d1..321dbfd314a18996cffa8d966130915a09fafd46 100644 (file)
@@ -187,6 +187,13 @@ if (CMAKE_BUILD_TYPE MATCHES "Debug")
 
   list(APPEND DEAL_II_DEFINITIONS_DEBUG "DEBUG")
 
+  # Enable invalid element access and other checks in the c++ standard libray:
+  list(APPEND DEAL_II_DEFINITIONS_DEBUG "_GLIBCXX_ASSERTIONS")
+  if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+    list(APPEND DEAL_II_DEFINITIONS_DEBUG "_LIBCPP_ENABLE_ASSERTIONS")
+    list(APPEND DEAL_II_DEFINITIONS_DEBUG "_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE")
+  endif()
+
   #
   # We have to ensure that we emit floating-point instructions in debug
   # mode that preserve the occurrence of floating-point exceptions and don't

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.