CMakeFiles.txt: fix sanitizers

This commit is contained in:
veclav talica 2024-09-27 17:49:56 +03:00
parent f4b52b5450
commit 055f59ad45

View File

@ -13,7 +13,7 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug) set(CMAKE_BUILD_TYPE Debug)
endif() endif()
if(CMAKE_BUILD_TYPE MATCHES Debug) if(NOT TWN_SANITIZE AND CMAKE_BUILD_TYPE MATCHES Debug)
set(TWN_SANITIZE ON) set(TWN_SANITIZE ON)
endif() endif()
@ -171,17 +171,17 @@ function(give_options_without_warnings target)
$<$<BOOL:${TWN_SANITIZE}>:-fstack-protector-all -fsanitize=undefined -fsanitize=address> $<$<BOOL:${TWN_SANITIZE}>:-fstack-protector-all -fsanitize=undefined -fsanitize=address>
$<$<BOOL:${EMSCRIPTEN}>:-gsource-map>) $<$<BOOL:${EMSCRIPTEN}>:-gsource-map>)
target_compile_options(${target} PRIVATE target_compile_options(${target} PUBLIC
${BUILD_FLAGS} ${BUILD_FLAGS}
$<$<CONFIG:Release>:${BUILD_FLAGS_RELEASE}> $<$<CONFIG:Release>:${BUILD_FLAGS_RELEASE}>
$<$<CONFIG:Debug>:${BUILD_FLAGS_DEBUG}>) $<$<CONFIG:Debug>:${BUILD_FLAGS_DEBUG}>)
target_link_options(${target} PRIVATE target_link_options(${target} PUBLIC
${BUILD_FLAGS} ${BUILD_FLAGS}
$<$<CONFIG:Release>:${BUILD_FLAGS_RELEASE}> $<$<CONFIG:Release>:${BUILD_FLAGS_RELEASE}>
$<$<CONFIG:Debug>:${BUILD_FLAGS_DEBUG}>) $<$<CONFIG:Debug>:${BUILD_FLAGS_DEBUG}>)
target_compile_definitions(${target} PRIVATE target_compile_definitions(${target} PUBLIC
ORGANIZATION_NAME="${ORGANIZATION_NAME}" ORGANIZATION_NAME="${ORGANIZATION_NAME}"
APP_NAME="${APP_NAME}" APP_NAME="${APP_NAME}"
PACKAGE_EXTENSION="${PACKAGE_EXTENSION}" PACKAGE_EXTENSION="${PACKAGE_EXTENSION}"