Skip to content

Commit fa74d7b

Browse files
committed
[CMake] Use LLVM_ENABLE_ASSERTIONS to enable assertions in libc++
Follow-up to https://reviews.llvm.org/D142279 for also enabling `libc++` assertions. This is particularly useful to recover the assertion checks we had with `llvm::Optional`, before moving to `std::optional`. Differential Revision: https://reviews.llvm.org/D143612 (cherry picked from commit d8e9a1a)
1 parent 7134163 commit fa74d7b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/cmake/modules/HandleLLVMOptions.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ if( LLVM_ENABLE_ASSERTIONS )
8585
endif()
8686
# Enable assertions in libstdc++.
8787
add_compile_definitions(_GLIBCXX_ASSERTIONS)
88+
# Enable assertions in libc++.
89+
add_compile_definitions(_LIBCPP_ENABLE_ASSERTIONS)
8890
endif()
8991

9092
if(LLVM_ENABLE_EXPENSIVE_CHECKS)

0 commit comments

Comments
 (0)