summaryrefslogtreecommitdiff
path: root/src/cmake/compiler/clang/settings.cmake
diff options
context:
space:
mode:
authorIntelligentQuantum <IntelligentQuantum@ProtonMail.Com>2022-05-01 00:09:51 +0430
committerGitHub <noreply@github.com>2022-04-30 21:39:51 +0200
commit769eea2cc0ca1975b2f26d6acd1ef1608710bd3d (patch)
treecc76a03b821afaf6e49ffc071e7e8e4968791578 /src/cmake/compiler/clang/settings.cmake
parent26c66e0d79615cbe9597c75ae2dc44a05323c4a5 (diff)
feat(Tools/MMapsGenerator): Improve multithreading of mmaps_generator (#10963)
* cherry-pick commit (https://github.com/Shauren/TrinityCore/commit/699edaa0144fa3b0033dc45e24ad74222cc8240e) Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
Diffstat (limited to 'src/cmake/compiler/clang/settings.cmake')
-rw-r--r--src/cmake/compiler/clang/settings.cmake46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/cmake/compiler/clang/settings.cmake b/src/cmake/compiler/clang/settings.cmake
index d53c673a94..93e85762e0 100644
--- a/src/cmake/compiler/clang/settings.cmake
+++ b/src/cmake/compiler/clang/settings.cmake
@@ -66,6 +66,52 @@ if(WITH_COREDEBUG)
message(STATUS "Clang: Debug-flags set (-g3)")
endif()
+if(MSAN)
+ target_compile_options(acore-compile-option-interface
+ INTERFACE
+ -fno-omit-frame-pointer
+ -fsanitize=memory
+ -fsanitize-memory-track-origins
+ -mllvm
+ -msan-keep-going=1)
+
+ target_link_options(acore-compile-option-interface
+ INTERFACE
+ -fno-omit-frame-pointer
+ -fsanitize=memory
+ -fsanitize-memory-track-origins)
+
+ message(STATUS "Clang: Enabled Memory Sanitizer MSan")
+endif()
+
+if(UBSAN)
+ target_compile_options(acore-compile-option-interface
+ INTERFACE
+ -fno-omit-frame-pointer
+ -fsanitize=undefined)
+
+ target_link_options(acore-compile-option-interface
+ INTERFACE
+ -fno-omit-frame-pointer
+ -fsanitize=undefined)
+
+ message(STATUS "Clang: Enabled Undefined Behavior Sanitizer UBSan")
+endif()
+
+if(TSAN)
+ target_compile_options(acore-compile-option-interface
+ INTERFACE
+ -fno-omit-frame-pointer
+ -fsanitize=thread)
+
+ target_link_options(acore-compile-option-interface
+ INTERFACE
+ -fno-omit-frame-pointer
+ -fsanitize=thread)
+
+ message(STATUS "Clang: Enabled Thread Sanitizer TSan")
+endif()
+
# -Wno-narrowing needed to suppress a warning in g3d
# -Wno-deprecated-register is needed to suppress gsoap warnings on Unix systems.
target_compile_options(acore-compile-option-interface