Skip to content

Commit 5dd94f7

Browse files
committed
cmake: make sanitizers link
1 parent 2d262ea commit 5dd94f7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,17 @@ find_package(Threads REQUIRED)
7575
if (NOT MSVC)
7676
if (LLAMA_SANITIZE_THREAD)
7777
add_compile_options(-fsanitize=thread)
78+
link_libraries(-fsanitize=thread)
7879
endif()
7980

8081
if (LLAMA_SANITIZE_ADDRESS)
8182
add_compile_options(-fsanitize=address -fno-omit-frame-pointer)
83+
link_libraries(-fsanitize=address)
8284
endif()
8385

8486
if (LLAMA_SANITIZE_UNDEFINED)
8587
add_compile_options(-fsanitize=undefined)
88+
link_libraries(-fsanitize=undefined)
8689
endif()
8790
endif()
8891

0 commit comments

Comments
 (0)