|
|
|
|
@ -7,6 +7,7 @@ if(NOT CMAKE_BUILD_TYPE)
|
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
option(ASAN "Enable address sanitizer" ON) |
|
|
|
|
option(UBSAN "Enable undefined behaviour sanitizer" ON) |
|
|
|
|
option(DEBUG "Enable debug mode in engine" ON) |
|
|
|
|
option(SPAWN "Build the shareware version" OFF) |
|
|
|
|
option(DIST "Dynamically link only glibc and SDL2" OFF) |
|
|
|
|
@ -19,6 +20,7 @@ option(NONET "Disable network" OFF)
|
|
|
|
|
if(BINARY_RELEASE) |
|
|
|
|
set(CMAKE_BUILD_TYPE "Release") |
|
|
|
|
set(ASAN OFF) |
|
|
|
|
set(UBSAN OFF) |
|
|
|
|
set(DEBUG OFF) |
|
|
|
|
set(DIST ON) |
|
|
|
|
set(FASTER OFF) |
|
|
|
|
@ -37,6 +39,7 @@ endif()
|
|
|
|
|
if(NIGHTLY_BUILD) |
|
|
|
|
set(CMAKE_BUILD_TYPE "RelWithDebInfo") |
|
|
|
|
set(ASAN OFF) |
|
|
|
|
set(UBSAN OFF) |
|
|
|
|
set(DEBUG ON) |
|
|
|
|
set(DIST ON) |
|
|
|
|
set(FASTER OFF) |
|
|
|
|
@ -305,6 +308,10 @@ foreach(target devilution devilutionx)
|
|
|
|
|
target_compile_options(${target} PUBLIC -fsanitize=address -fsanitize-recover=address) |
|
|
|
|
target_link_libraries(${target} PUBLIC -fsanitize=address -fsanitize-recover=address) |
|
|
|
|
endif() |
|
|
|
|
if(UBSAN) |
|
|
|
|
target_compile_options(${target} PUBLIC -fsanitize=undefined) |
|
|
|
|
target_link_libraries(${target} PUBLIC -fsanitize=undefined) |
|
|
|
|
endif() |
|
|
|
|
endforeach(target devilution devilutionx) |
|
|
|
|
|
|
|
|
|
if(DIST AND CMAKE_CXX_COMPILER_ID MATCHES "GCC") |
|
|
|
|
|