diff options
author | Andreas Schneider <asn@samba.org> | 2020-02-12 10:55:20 +0100 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2020-02-12 10:55:20 +0100 |
commit | 7194faf53549b5af5f5db13bb7a9819adf45164c (patch) | |
tree | 05ede4e3a35ea1494ea2dd727374d7a7b156d47e | |
parent | 344801fda7b2b50b1139056168b470ad656c20b5 (diff) | |
download | socket_wrapper-master-thread.tar.gz socket_wrapper-master-thread.tar.xz socket_wrapper-master-thread.zip |
cmake: Add ThreadSanitizer compile flagsmaster-thread
Signed-off-by: Andreas Schneider <asn@samba.org>
-rw-r--r-- | cmake/Modules/DefineCompilerFlags.cmake | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cmake/Modules/DefineCompilerFlags.cmake b/cmake/Modules/DefineCompilerFlags.cmake index 3277b99..c92182d 100644 --- a/cmake/Modules/DefineCompilerFlags.cmake +++ b/cmake/Modules/DefineCompilerFlags.cmake @@ -34,4 +34,16 @@ if (UNIX AND NOT WIN32) CACHE STRING "Flags used by the linker during the creation of shared libraries during UNDEFINEDSANITIZER builds.") set(CMAKE_EXEC_LINKER_FLAGS_UNDEFINEDSANITIZER "-fsanitize=undefined" CACHE STRING "Flags used by the linker during UNDEFINEDSANITIZER builds.") + + # Activate with: -DCMAKE_BUILD_TYPE=ThreadSanitizer + set(CMAKE_C_FLAGS_THREADSANITIZER "-g -O1 -fsanitize=thread" + CACHE STRING "Flags used by the C compiler during THREADSANITIZER builds.") + set(CMAKE_CXX_FLAGS_THREADSANITIZER "-g -O1 -fsanitize=thread" + CACHE STRING "Flags used by the CXX compiler during THREADSANITIZER builds.") + set(CMAKE_SHARED_LINKER_FLAGS_THREADSANITIZER "-fsanitize=thread" + CACHE STRING "Flags used by the linker during the creation of shared libraries during THREADSANITIZER builds.") + set(CMAKE_MODULE_LINKER_FLAGS_THREADSANITIZER "-fsanitize=thread" + CACHE STRING "Flags used by the linker during the creation of shared libraries during THREADSANITIZER builds.") + set(CMAKE_EXEC_LINKER_FLAGS_THREADSANITIZER "-fsanitize=thread" + CACHE STRING "Flags used by the linker during THREADSANITIZER builds.") endif() |