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 10, 2024
1 parent 2285fbc commit e42bd53
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmake/setup_compiler_flags_gnu.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit e42bd53

Please sign in to comment.