Add other sanitizers

This commit is contained in:
NepDisk 2026-02-20 10:50:05 -05:00
parent 2e147367eb
commit 752548e7ca
2 changed files with 12 additions and 0 deletions

View file

@ -92,6 +92,8 @@ option(SRB2_CONFIG_TRACY "Compile with Tracy profiling enabled" OFF)
option(SRB2_CONFIG_ASAN "Compile with AddressSanitizer (libasan)." OFF)
option(SRB2_CONFIG_UBSAN "Compile with UndefinedBehaviorSanitizer (libubsan)." OFF)
option(SRB2_CONFIG_LSAN "Compile with LeakSanitizer (liblsan)." OFF)
option(SRB2_CONFIG_TSAN "Compile with ThreadSanitizer (libtsan)." OFF)
option(SRB2_CONFIG_MSAN "Compile with MemorySanitizer (libmsan)." OFF)
option(SRB2_CONFIG_NOVERIFYIWADS "Compile with IWAD verification turned off." OFF)
set(SRB2_CONFIG_ASSET_DIRECTORY "" CACHE PATH "Path to directory that contains all asset files for the installer. If set, assets will be part of installation and cpack.")
option(SRB2_CONFIG_LTO "Enable link time optimizations, improves performance at the cost of longer link times." ON)

View file

@ -249,6 +249,16 @@ if(SRB2_CONFIG_LSAN)
target_link_options(BLANKART PRIVATE -fsanitize=leak)
endif()
if(SRB2_CONFIG_TSAN)
target_compile_options(BLANKART PRIVATE -fsanitize=thread)
target_link_options(BLANKART PRIVATE -fsanitize=thread)
endif()
if(SRB2_CONFIG_MSAN)
target_compile_options(BLANKART PRIVATE -fsanitize=memory)
target_link_options(BLANKART PRIVATE -fsanitize=memory)
endif()
if(SRB2_CONFIG_TIDY)
set(CMAKE_CXX_CLANG_TIDY "clang-tidy;-checks=*")
endif()