From: Daniel Arndt Date: Thu, 10 Oct 2024 17:01:25 +0000 (-0400) Subject: Don't define _LIBCPP_ENABLE_ASSERTIONS for clang++-19 and later X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9fa7eec2c472d1213062228d82601fce569397e5;p=dealii.git Don't define _LIBCPP_ENABLE_ASSERTIONS for clang++-19 and later --- diff --git a/cmake/setup_compiler_flags_gnu.cmake b/cmake/setup_compiler_flags_gnu.cmake index a352c98392..d2168e2002 100644 --- a/cmake/setup_compiler_flags_gnu.cmake +++ b/cmake/setup_compiler_flags_gnu.cmake @@ -192,7 +192,11 @@ if (CMAKE_BUILD_TYPE MATCHES "Debug") # Enable invalid element access and other checks in the c++ standard libray: list(APPEND DEAL_II_DEFINITIONS_DEBUG "_GLIBCXX_ASSERTIONS") if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - list(APPEND DEAL_II_DEFINITIONS_DEBUG "_LIBCPP_ENABLE_ASSERTIONS") + 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") + endif() list(APPEND DEAL_II_DEFINITIONS_DEBUG "_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE") endif()