Skip to content

Commit 9d45ef6

Browse files
authored
Merge pull request #6273 from akyrtzi/pr/stable/libcpp-assertions
[stable/20221013][CMake] Use `LLVM_ENABLE_ASSERTIONS` to enable assertions in `libc++`
2 parents 18aa09a + fa74d7b commit 9d45ef6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/cmake/modules/HandleLLVMOptions.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ if( LLVM_ENABLE_ASSERTIONS )
8383
endforeach()
8484
endif()
8585
endif()
86+
# Enable assertions in libstdc++.
87+
add_compile_definitions(_GLIBCXX_ASSERTIONS)
88+
# Enable assertions in libc++.
89+
add_compile_definitions(_LIBCPP_ENABLE_ASSERTIONS)
8690
endif()
8791

8892
if(LLVM_ENABLE_EXPENSIVE_CHECKS)

0 commit comments

Comments
 (0)