Skip to content

Commit

Permalink
[CMake] Use LLVM_ENABLE_ASSERTIONS to enable the hardened mode in l…
Browse files Browse the repository at this point in the history
…ibc++.

Use the new libc++ hardened mode instead of the deprecated safe mode.

Reviewed By: benlangmuir

Differential Revision: https://reviews.llvm.org/D156377

(cherry picked from commit 194e2ba)
  • Loading branch information
var-const authored and tru committed Jul 28, 2023
1 parent 726f698 commit 14dbd4b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/cmake/modules/HandleLLVMOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ if( LLVM_ENABLE_ASSERTIONS )
endif()
# Enable assertions in libstdc++.
add_compile_definitions(_GLIBCXX_ASSERTIONS)
# Enable assertions in libc++.
add_compile_definitions(_LIBCPP_ENABLE_ASSERTIONS)
# Enable the hardened mode in libc++.
add_compile_definitions(_LIBCPP_ENABLE_HARDENED_MODE)
endif()

if(LLVM_ENABLE_EXPENSIVE_CHECKS)
Expand Down

0 comments on commit 14dbd4b

Please sign in to comment.