Skip to content

Commit

Permalink
Don't define _LIBCPP_ENABLE_ASSERTIONS for clang++-19 and later
Browse files Browse the repository at this point in the history
  • Loading branch information
masterleinad committed Oct 11, 2024
1 parent 2285fbc commit 9fa7eec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmake/setup_compiler_flags_gnu.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 9fa7eec

Please sign in to comment.