]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Only enable -ffp-exception-behavior=strict for some platforms. 15533/head
authorDavid Wells <drwells@email.unc.edu>
Thu, 29 Jun 2023 21:12:08 +0000 (17:12 -0400)
committerMatthias Maier <tamiko@43-1.org>
Fri, 30 Jun 2023 01:55:34 +0000 (20:55 -0500)
This doesn't work with AppleClang 14.0, even though the enable_with_supported()
flag works.

cmake/setup_compiler_flags_gnu.cmake

index aeed104ec6015b593c46ce5e4c299d6bcc550846..4ad63ecc2b4b0f415db29b1aa0fef81a3fbea1fe 100644 (file)
@@ -212,7 +212,19 @@ if (CMAKE_BUILD_TYPE MATCHES "Debug")
   #
   # https://github.com/dealii/dealii/issues/15496
   #
-  enable_if_supported(DEAL_II_CXX_FLAGS_DEBUG "-ffp-exception-behavior=strict")
+  # ... except this doesn't presently work with AppleClang versions before 16.0.
+  # They support this flag but it is not compatible with C++14: see
+  #
+  # https://github.com/dealii/dealii/issues/15531
+  #
+  # This flag works with standard Clang 13.0 or newer.
+  #
+  if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
+        AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "13.0")
+      OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"
+        AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "16.0"))
+    enable_if_supported(DEAL_II_CXX_FLAGS_DEBUG "-ffp-exception-behavior=strict")
+  endif()
 
   #
   # In recent versions, gcc often eliminates too much debug information

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.