Remove ASAN from sanitizers config
SDL2 seems to use some unintialized memory in SDL_Init() so ASAN just kills the program right away if it's enabled (sad). UBSAN is still very useful in its own right, though, so makes sense to have an option to enable only that.
This commit is contained in:
parent
3952d93bb0
commit
61c0e17fd8
@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.10)
|
|||||||
project(epec-mcu-emulator LANGUAGES C)
|
project(epec-mcu-emulator LANGUAGES C)
|
||||||
|
|
||||||
option(WERROR "Treat warnings as errors" OFF)
|
option(WERROR "Treat warnings as errors" OFF)
|
||||||
option(SANITIZERS "Enable memory and undefined behaviour sanitizers" OFF)
|
option(UBSAN "Enable undefined behaviour sanitizer" OFF)
|
||||||
option(PERFMON "Monitor performance of game code" ON)
|
option(PERFMON "Monitor performance of game code" ON)
|
||||||
|
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
@ -15,9 +15,9 @@ macro(set_default_target_options target)
|
|||||||
if(${WERROR})
|
if(${WERROR})
|
||||||
target_compile_options(${target} PRIVATE -Werror)
|
target_compile_options(${target} PRIVATE -Werror)
|
||||||
endif()
|
endif()
|
||||||
if (${SANITIZERS})
|
if(${UBSAN})
|
||||||
target_compile_options(${target} PRIVATE -fsanitize=memory,undefined)
|
target_compile_options(${target} PRIVATE -fsanitize=undefined)
|
||||||
target_link_options(${target} PRIVATE -fsanitize=memory,undefined)
|
target_link_options(${target} PRIVATE -fsanitize=undefined)
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user