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:
Camden Dixie O'Brien 2025-01-02 17:13:39 +00:00
parent 3952d93bb0
commit 61c0e17fd8

View File

@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.10)
project(epec-mcu-emulator LANGUAGES C)
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)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
@ -15,9 +15,9 @@ macro(set_default_target_options target)
if(${WERROR})
target_compile_options(${target} PRIVATE -Werror)
endif()
if (${SANITIZERS})
target_compile_options(${target} PRIVATE -fsanitize=memory,undefined)
target_link_options(${target} PRIVATE -fsanitize=memory,undefined)
if(${UBSAN})
target_compile_options(${target} PRIVATE -fsanitize=undefined)
target_link_options(${target} PRIVATE -fsanitize=undefined)
endif()
endmacro()