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_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)
|
||||
|
||||
Reference in New Issue
Block a user