mirror of
https://github.com/OpenRCT2/OpenRCT2.git
synced 2025-01-22 10:21:57 -05:00
CMake option to turn on the AddressSanitizer (#22985)
This commit is contained in:
parent
ff07f09fe7
commit
498a2e349b
1 changed files with 10 additions and 0 deletions
|
@ -110,6 +110,8 @@ option(DISABLE_HTTP "Disable HTTP support.")
|
|||
option(DISABLE_NETWORK "Disable multiplayer functionality. Mainly for testing.")
|
||||
option(DISABLE_TTF "Disable support for TTF provided by freetype2.")
|
||||
option(ENABLE_SCRIPTING "Enable script / plugin support." ON)
|
||||
option(ENABLE_ASAN "Enable the AddressSanitizer.")
|
||||
option(ENABLE_UBSAN "Enable the UndefinedBehaviourSanitizer.")
|
||||
|
||||
option(DISABLE_GUI "Don't build GUI. (Headless only.)")
|
||||
|
||||
|
@ -396,6 +398,14 @@ endif ()
|
|||
if (ENABLE_SCRIPTING)
|
||||
target_compile_options(libopenrct2 PUBLIC -DENABLE_SCRIPTING)
|
||||
endif ()
|
||||
if (ENABLE_ASAN)
|
||||
target_compile_options(libopenrct2 PUBLIC -fsanitize=address)
|
||||
target_link_options(libopenrct2 PUBLIC -fsanitize=address)
|
||||
endif ()
|
||||
if (ENABLE_UBSAN)
|
||||
target_compile_options(libopenrct2 PUBLIC -fsanitize=undefined)
|
||||
target_link_options(libopenrct2 PUBLIC -fsanitize=undefined)
|
||||
endif ()
|
||||
|
||||
|
||||
# g2
|
||||
|
|
Loading…
Reference in a new issue