]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Only define _LIBCPP_ENABLE_ASSERTIONS for AppleClang < 17 18641/head
authorDaniel Arndt <arndtd@ornl.gov>
Tue, 8 Jul 2025 17:31:17 +0000 (13:31 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Tue, 8 Jul 2025 17:31:47 +0000 (13:31 -0400)
cmake/setup_compiler_flags_gnu.cmake

index af05e14ceebdaa0eea24e5b07b8055b9d553a681..3f768c03ea99222a42d3ef0c1adcdb2e17a61a90 100644 (file)
@@ -192,10 +192,16 @@ if (CMAKE_BUILD_TYPE MATCHES "Debug")
   # Enable invalid element access and other checks in the c++ standard library:
   list(APPEND DEAL_II_DEFINITIONS_DEBUG "_GLIBCXX_ASSERTIONS")
   if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-    if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19)
-      # _LIBCPP_ENABLE_ASSERTIONS was deprecated in clang++-19
-      # _LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE should be used instead
-      list(APPEND DEAL_II_DEFINITIONS_DEBUG "_LIBCPP_ENABLE_ASSERTIONS")
+    # _LIBCPP_ENABLE_ASSERTIONS was deprecated in clang++-19
+    # _LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE should be used instead
+    if (CMAKE_CXX_COMPILER_ID STREQUAL AppleClang)
+      if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17)
+        list(APPEND DEAL_II_DEFINITIONS_DEBUG "_LIBCPP_ENABLE_ASSERTIONS")
+      endif()
+    else()
+      if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19)
+        list(APPEND DEAL_II_DEFINITIONS_DEBUG "_LIBCPP_ENABLE_ASSERTIONS")
+      endif()
     endif()
     list(APPEND DEAL_II_DEFINITIONS_DEBUG "_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE")
   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.