Fix sanitizers not being actually enabled in debug build

This commit is contained in:
SimoneN64
2023-03-19 16:12:54 +01:00
parent de6a9f2b82
commit c4018a7bca

View File

@@ -40,6 +40,10 @@ include_directories(
add_compile_definitions(SIMD_SUPPORT) add_compile_definitions(SIMD_SUPPORT)
add_compile_options(-mssse3 -msse4.1) add_compile_options(-mssse3 -msse4.1)
if(${CMAKE_BUILD_TYPE} MATCHES Debug)
add_compile_options(-fsanitize=address -fsanitize=undefined)
add_link_options(-fsanitize=address -fsanitize=undefined)
endif()
add_subdirectory(frontend) add_subdirectory(frontend)
add_subdirectory(frontend/imgui) add_subdirectory(frontend/imgui)
@@ -66,11 +70,6 @@ file(REMOVE
target_link_libraries(gadolinium PUBLIC frontend frontend-imgui target_link_libraries(gadolinium PUBLIC frontend frontend-imgui
discord-rpc imgui nfd parallel-rdp backend fmt::fmt nlohmann_json::nlohmann_json core jit registers interpreter mmio rsp SDL2::SDL2main SDL2::SDL2) discord-rpc imgui nfd parallel-rdp backend fmt::fmt nlohmann_json::nlohmann_json core jit registers interpreter mmio rsp SDL2::SDL2main SDL2::SDL2)
if(${CMAKE_BUILD_TYPE} MATCHES Debug)
add_compile_options(-fsanitize=address -fsanitize=undefined)
add_link_options(-fsanitize=address -fsanitize=undefined)
endif()
if(WIN32) if(WIN32)
target_compile_definitions(gadolinium PUBLIC NOMINMAX _CRT_SECURE_NO_WARNINGS) target_compile_definitions(gadolinium PUBLIC NOMINMAX _CRT_SECURE_NO_WARNINGS)
if(MSVC) if(MSVC)