forked from cantyonion/LiveParise
add cmake option to disable asan
This commit is contained in:
@@ -4,22 +4,29 @@ project(Live\ Parise C)
|
|||||||
set(CMAKE_C_STANDARD 11)
|
set(CMAKE_C_STANDARD 11)
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
|
include(FetchContent)
|
||||||
|
|
||||||
|
option(ENABLE_ASAN "Enable AddressSanitizer" ON)
|
||||||
|
|
||||||
add_compile_options(
|
add_compile_options(
|
||||||
-Wall
|
-Wall
|
||||||
-Wextra
|
-Wextra
|
||||||
-O2
|
-O2
|
||||||
-g3
|
-g3)
|
||||||
-fsanitize=address
|
|
||||||
-fsanitize=undefined
|
|
||||||
-fno-omit-frame-pointer
|
|
||||||
)
|
|
||||||
|
|
||||||
add_link_options(
|
if (ENABLE_ASAN)
|
||||||
-fsanitize=address
|
add_compile_options(
|
||||||
-fsanitize=undefined
|
-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
|
# For CURL
|
||||||
set(BUILD_STATIC_LIBS ON)
|
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 SUBROOMID[] = ""; // at line 43 in main.c
|
||||||
const char SS[] = "";
|
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.
|
||||||
|
|||||||
Reference in New Issue
Block a user