]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Define NDEBUG in release mode 12503/head
authorRene Gassmoeller <rene.gassmoeller@mailbox.org>
Sat, 26 Jun 2021 15:55:01 +0000 (11:55 -0400)
committerRene Gassmoeller <rene.gassmoeller@mailbox.org>
Thu, 1 Jul 2021 19:51:38 +0000 (15:51 -0400)
cmake/setup_compiler_flags_gnu.cmake
cmake/setup_compiler_flags_intel.cmake
cmake/setup_compiler_flags_msvc.cmake

index ca26003cbee2bae3bd0fbf19141311fd5485404a..737a90b821071f93162ae9676308fb4195028b6a 100644 (file)
@@ -187,6 +187,12 @@ IF (CMAKE_BUILD_TYPE MATCHES "Release")
   ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-funroll-all-loops")
   ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-fstrict-aliasing")
 
+  #
+  # Disable assert() in deal.II and user projects in release mode
+  #
+  LIST(APPEND DEAL_II_DEFINITIONS_RELEASE "NDEBUG")
+  LIST(APPEND DEAL_II_USER_DEFINITIONS_RELEASE "NDEBUG")
+
   #
   # There are many places in the library where we create a new typedef and then
   # immediately use it in an Assert. Hence, only ignore unused typedefs in Release
index 17b8fc959b78b800f80c0b5c87002f49ebfe9a21..b83493f848002981281ce4b6a2e1d1db92d71247 100644 (file)
@@ -183,6 +183,12 @@ IF (CMAKE_BUILD_TYPE MATCHES "Release")
 
   ADD_FLAGS(DEAL_II_CXX_FLAGS_RELEASE "-O2")
 
+  #
+  # Disable assert() in deal.II and user projects in release mode
+  #
+  LIST(APPEND DEAL_II_DEFINITIONS_RELEASE "NDEBUG")
+  LIST(APPEND DEAL_II_USER_DEFINITIONS_RELEASE "NDEBUG")
+
   # equivalent to -fno-strict-aliasing:
   ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-no-ansi-alias")
 
index 32921fc03de6750a48f48319aefcb4023f487850..898b5273068987e7d9e30882bb3c22a63ddf6de8 100644 (file)
@@ -99,6 +99,13 @@ IF (CMAKE_BUILD_TYPE MATCHES "Release")
   # General optimization flags: (very basic for now)
   #
   ADD_FLAGS(DEAL_II_CXX_FLAGS_RELEASE "/O2")
+
+  #
+  # Disable assert() in deal.II and user projects in release mode
+  #
+  LIST(APPEND DEAL_II_DEFINITIONS_RELEASE "NDEBUG")
+  LIST(APPEND DEAL_II_USER_DEFINITIONS_RELEASE "NDEBUG")
+
 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.