CMakeFiles.txt: fix sanitizers
This commit is contained in:
parent
f4b52b5450
commit
055f59ad45
@ -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()
|
||||||
|
|
||||||
@ -168,20 +168,20 @@ function(give_options_without_warnings target)
|
|||||||
-g3
|
-g3
|
||||||
-gdwarf
|
-gdwarf
|
||||||
-fno-omit-frame-pointer
|
-fno-omit-frame-pointer
|
||||||
$<$<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}"
|
||||||
|
Loading…
Reference in New Issue
Block a user