add cmake option to disable asan
This commit is contained in:
parent
93cbf7c87b
commit
a9a442b5ac
@ -4,22 +4,29 @@ project(Live\ Parise C)
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
include(FetchContent)
|
||||
|
||||
option(ENABLE_ASAN "Enable AddressSanitizer" ON)
|
||||
|
||||
add_compile_options(
|
||||
-Wall
|
||||
-Wextra
|
||||
-O2
|
||||
-g3
|
||||
-fsanitize=address
|
||||
-fsanitize=undefined
|
||||
-fno-omit-frame-pointer
|
||||
)
|
||||
-g3)
|
||||
|
||||
add_link_options(
|
||||
-fsanitize=address
|
||||
-fsanitize=undefined
|
||||
)
|
||||
if (ENABLE_ASAN)
|
||||
add_compile_options(
|
||||
-fsanitize=address
|
||||
-fsanitize=undefined
|
||||
-fno-omit-frame-pointer
|
||||
)
|
||||
|
||||
include(FetchContent)
|
||||
add_link_options(
|
||||
-fsanitize=address
|
||||
-fsanitize=undefined
|
||||
)
|
||||
message("asan is on. if have any problems, disable it.")
|
||||
endif ()
|
||||
|
||||
# For CURL
|
||||
set(BUILD_STATIC_LIBS ON)
|
||||
|
13
README.md
13
README.md
@ -22,3 +22,16 @@ Set these vars to you need
|
||||
const char SUBROOMID[] = ""; // at line 43 in main.c
|
||||
const char SS[] = "";
|
||||
```
|
||||
|
||||
### AddressSanitizer
|
||||
|
||||
Asan is enabled by default.
|
||||
|
||||
```bash
|
||||
cmake .. -DENABLE_ASAN=OFF # disable asan
|
||||
```
|
||||
or
|
||||
```CMake
|
||||
option(ENABLE_ASAN "Enable AddressSanitizer" OFF) # at line 9
|
||||
```
|
||||
to disable it.
|
||||
|
Loading…
x
Reference in New Issue
Block a user