diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d9cf177d..827eb699f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4a2db6a7b..981b7c8de 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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()