From 9fa7eec2c472d1213062228d82601fce569397e5 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 10 Oct 2024 13:01:25 -0400 Subject: [PATCH] Don't define _LIBCPP_ENABLE_ASSERTIONS for clang++-19 and later --- cmake/setup_compiler_flags_gnu.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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() -- 2.39.5