diff --git a/cmake/setup_compiler_flags_gnu.cmake b/cmake/setup_compiler_flags_gnu.cmake index a352c9839295..0847db4316d7 100644 --- a/cmake/setup_compiler_flags_gnu.cmake +++ b/cmake/setup_compiler_flags_gnu.cmake @@ -192,7 +192,10 @@ 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 + list(APPEND DEAL_II_DEFINITIONS_DEBUG "_LIBCPP_ENABLE_ASSERTIONS") + endif() list(APPEND DEAL_II_DEFINITIONS_DEBUG "_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE") endif()