build : enable libstdc++ assertions for debug builds (#4275)

This commit is contained in:
Jared Van Bortel
2023-12-01 13:18:35 -05:00
committed by GitHub
parent 03562f3a86
commit 511f52c334
2 changed files with 9 additions and 0 deletions

View File

@ -116,6 +116,11 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
include(CheckCXXCompilerFlag)
# enable libstdc++ assertions for debug builds
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
add_compile_definitions($<$<CONFIG:Debug>:_GLIBCXX_ASSERTIONS>)
endif()
if (NOT MSVC)
if (LLAMA_SANITIZE_THREAD)
add_compile_options(-fsanitize=thread)