File tree Expand file tree Collapse file tree 4 files changed +70
-0
lines changed Expand file tree Collapse file tree 4 files changed +70
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,23 @@ find_package(Threads REQUIRED)
44
55llama_add_compile_flags()
66
7+ if (NOT MSVC )
8+ if (LLAMA_SANITIZE_THREAD)
9+ add_compile_options (-fsanitize=thread)
10+ link_libraries (-fsanitize=thread)
11+ endif ()
12+
13+ if (LLAMA_SANITIZE_ADDRESS)
14+ add_compile_options (-fsanitize=address -fno-omit-frame-pointer)
15+ link_libraries (-fsanitize=address)
16+ endif ()
17+
18+ if (LLAMA_SANITIZE_UNDEFINED)
19+ add_compile_options (-fsanitize=undefined)
20+ link_libraries (-fsanitize=undefined)
21+ endif ()
22+ endif ()
23+
724# Build info header
825#
926
Original file line number Diff line number Diff line change @@ -10,6 +10,23 @@ find_package(Threads REQUIRED)
1010
1111llama_add_compile_flags()
1212
13+ if (NOT MSVC )
14+ if (LLAMA_SANITIZE_THREAD)
15+ add_compile_options (-fsanitize=thread)
16+ link_libraries (-fsanitize=thread)
17+ endif ()
18+
19+ if (LLAMA_SANITIZE_ADDRESS)
20+ add_compile_options (-fsanitize=address -fno-omit-frame-pointer)
21+ link_libraries (-fsanitize=address)
22+ endif ()
23+
24+ if (LLAMA_SANITIZE_UNDEFINED)
25+ add_compile_options (-fsanitize=undefined)
26+ link_libraries (-fsanitize=undefined)
27+ endif ()
28+ endif ()
29+
1330# examples
1431
1532include_directories (${CMAKE_CURRENT_SOURCE_DIR} )
Original file line number Diff line number Diff line change 11llama_add_compile_flags()
22
3+ if (NOT MSVC )
4+ if (LLAMA_SANITIZE_THREAD)
5+ add_compile_options (-fsanitize=thread)
6+ link_libraries (-fsanitize=thread)
7+ endif ()
8+
9+ if (LLAMA_SANITIZE_ADDRESS)
10+ add_compile_options (-fsanitize=address -fno-omit-frame-pointer)
11+ link_libraries (-fsanitize=address)
12+ endif ()
13+
14+ if (LLAMA_SANITIZE_UNDEFINED)
15+ add_compile_options (-fsanitize=undefined)
16+ link_libraries (-fsanitize=undefined)
17+ endif ()
18+ endif ()
19+
320#
421# libraries
522#
Original file line number Diff line number Diff line change 1+ llama_add_compile_flags()
2+
3+ if (NOT MSVC )
4+ if (LLAMA_SANITIZE_THREAD)
5+ add_compile_options (-fsanitize=thread)
6+ link_libraries (-fsanitize=thread)
7+ endif ()
8+
9+ if (LLAMA_SANITIZE_ADDRESS)
10+ add_compile_options (-fsanitize=address -fno-omit-frame-pointer)
11+ link_libraries (-fsanitize=address)
12+ endif ()
13+
14+ if (LLAMA_SANITIZE_UNDEFINED)
15+ add_compile_options (-fsanitize=undefined)
16+ link_libraries (-fsanitize=undefined)
17+ endif ()
18+ endif ()
19+
120function (llama_test target )
221 include (CMakeParseArguments)
322 set (options )
You can’t perform that action at this time.
0 commit comments