CMakeLists.txt: haiku support, optional sanitizers

This commit is contained in:
veclav talica 2024-09-24 17:29:40 +00:00
parent 34a081fccd
commit 4b0d6a880b

View File

@ -30,6 +30,13 @@ if(EMSCRIPTEN)
endif() endif()
endif() endif()
if(HAIKU)
if(TWN_SANITIZE)
message(WARNING "TWN_SANITIZE is set, but not supported - it is turned off")
set(TWN_SANITIZE OFF CACHE INTERNAL "")
endif()
endif()
# add -fPIC globally so that it's linked well # add -fPIC globally so that it's linked well
add_compile_options($<$<BOOL:${TWN_FEATURE_DYNLIB_GAME}>:-fPIC>) add_compile_options($<$<BOOL:${TWN_FEATURE_DYNLIB_GAME}>:-fPIC>)
@ -156,9 +163,7 @@ function(give_options_without_warnings target)
-g3 -g3
-gdwarf -gdwarf
-fno-omit-frame-pointer -fno-omit-frame-pointer
-fstack-protector-all $<$<BOOL:${TWN_SANITIZE}>:-fstack-protector-all -fsanitize=undefined -fsanitize=address>
-fsanitize=undefined
-fsanitize=address
$<$<BOOL:${EMSCRIPTEN}>:-gsource-map>) $<$<BOOL:${EMSCRIPTEN}>:-gsource-map>)
target_compile_options(${target} PRIVATE target_compile_options(${target} PRIVATE
@ -231,6 +236,7 @@ function(link_deps target)
$<$<NOT:$<BOOL:${EMSCRIPTEN}>>:SDL2::SDL2> $<$<NOT:$<BOOL:${EMSCRIPTEN}>>:SDL2::SDL2>
physfs-static physfs-static
xms) xms)
target_include_directories(${target} PUBLIC ${SDL2_INCLUDE_DIRS})
endfunction() endfunction()