]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: fix compilation with bundled boost and modern clang 16541/head
authorMatthias Maier <tamiko@43-1.org>
Wed, 17 Jan 2024 21:38:40 +0000 (15:38 -0600)
committerMatthias Maier <tamiko@43-1.org>
Thu, 25 Jan 2024 16:54:18 +0000 (10:54 -0600)
std::unary_function has been removed in C++17. Fix compilation with
clang and other compiles that enforce strict standard compliance by
exporting BOOST_NO_CXX98_FUNCTION_BASE,

https://github.com/boostorg/config/pull/430

bundled/setup_bundled.cmake

index d6594379c538bfec4fc294c10400bae9926d227e..e33eea70bdf888fdb6684c0d50890ed06aa8cb7f 100644 (file)
@@ -57,6 +57,16 @@ macro(feature_boost_configure_bundled)
     list(APPEND DEAL_II_DEFINITIONS "BOOST_ALL_NO_LIB")
   endif()
 
+  if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+    #
+    # std::unary_function has been removed in C++17. Fix compilation with
+    # clang (that enforces strict standard compliance) by exporting
+    # BOOST_NO_CXX98_FUNCTION_BASE,
+    # https://github.com/boostorg/config/pull/430
+    #
+    list(APPEND DEAL_II_DEFINITIONS "BOOST_NO_CXX98_FUNCTION_BASE")
+  endif()
+
   enable_if_supported(DEAL_II_WARNING_FLAGS "-Wno-unused-local-typedefs")
 
   list(APPEND DEAL_II_BUNDLED_INCLUDE_DIRS ${BOOST_FOLDER}/include)

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.