mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-22 22:01:46 +00:00
[client] add support for compiling with AddressSanitizer
This commit is contained in:
parent
fa1deafd58
commit
0b890ed1ac
1 changed files with 8 additions and 0 deletions
|
@ -27,6 +27,9 @@ add_feature_info(ENABLE_CB_X11 ENABLE_CB_X11 "X11 Clipboard Integration.")
|
|||
option(ENABLE_BACKTRACE "Enable backtrace support on crash" ON)
|
||||
add_feature_info(ENABLE_BACKTRACE ENABLE_BACKTRACE "Backtrace support.")
|
||||
|
||||
option(ENABLE_ASAN "Build with AddressSanitizer" OFF)
|
||||
add_feature_info(ENABLE_ASAN ENABLE_ASAN "AddressSanitizer support.")
|
||||
|
||||
add_compile_options(
|
||||
"-Wall"
|
||||
"-Werror"
|
||||
|
@ -40,6 +43,11 @@ add_compile_options(
|
|||
set(EXE_FLAGS "-Wl,--gc-sections -z noexecstack")
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
|
||||
if(ENABLE_ASAN)
|
||||
add_compile_options("-fno-omit-frame-pointer" "-fsanitize=address")
|
||||
set(EXE_FLAGS "${EXE_FLAGS} -fno-omit-frame-pointer -fsanitize=address")
|
||||
endif()
|
||||
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PKGCONFIG REQUIRED
|
||||
sdl2
|
||||
|
|
Loading…
Reference in a new issue