cmake: make sanitizers linking #468
This commit is contained in:
parent
2d27013343
commit
779c37f916
1 changed files with 3 additions and 0 deletions
|
@ -76,14 +76,17 @@ find_package(Threads REQUIRED)
|
||||||
if (NOT MSVC)
|
if (NOT MSVC)
|
||||||
if (LLAMA_SANITIZE_THREAD)
|
if (LLAMA_SANITIZE_THREAD)
|
||||||
add_compile_options(-fsanitize=thread)
|
add_compile_options(-fsanitize=thread)
|
||||||
|
link_libraries(-fsanitize=thread)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (LLAMA_SANITIZE_ADDRESS)
|
if (LLAMA_SANITIZE_ADDRESS)
|
||||||
add_compile_options(-fsanitize=address -fno-omit-frame-pointer)
|
add_compile_options(-fsanitize=address -fno-omit-frame-pointer)
|
||||||
|
link_libraries(-fsanitize=address)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (LLAMA_SANITIZE_UNDEFINED)
|
if (LLAMA_SANITIZE_UNDEFINED)
|
||||||
add_compile_options(-fsanitize=undefined)
|
add_compile_options(-fsanitize=undefined)
|
||||||
|
link_libraries(-fsanitize=undefined)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue