From: Matthias Maier Date: Wed, 17 Jan 2024 21:38:40 +0000 (-0600) Subject: CMake: fix compilation with bundled boost and modern clang X-Git-Tag: relicensing~142^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b168d65d186581410ea95eb67f920811c516cb9;p=dealii.git CMake: fix compilation with bundled boost and modern clang 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 --- diff --git a/bundled/setup_bundled.cmake b/bundled/setup_bundled.cmake index 944ebd8d94..0027cde4f1 100644 --- a/bundled/setup_bundled.cmake +++ b/bundled/setup_bundled.cmake @@ -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") enable_if_supported(DEAL_II_WARNING_FLAGS "-Wno-parentheses")