Merge pull request #3158 from Carbenium/tsan
Build: Add ThreadSanitizer (TSan) support
This commit is contained in:
commit
af354eb718
|
@ -93,6 +93,11 @@ mark_as_advanced(
|
|||
option(BUILD_TEST_SUITE "Build the test suite" 0)
|
||||
option(BUILD_MAN "Build man pages" 1)
|
||||
option(ASAN "DEBUGGING: Build with AddressSanitizer (ASan) support" 0)
|
||||
option(TSAN "DEBUGGING: Build with ThreadSanitizer (TSan) support" 0)
|
||||
|
||||
if(ASAN AND TSAN)
|
||||
message(FATAL_ERROR "ASAN and TSAN options are mutually exclusive")
|
||||
endif()
|
||||
|
||||
set(ZM_RUNDIR "/var/run/zm" CACHE PATH
|
||||
"Location of transient process files, default: /var/run/zm")
|
||||
|
|
|
@ -19,3 +19,15 @@ if(ASAN)
|
|||
|
||||
message(STATUS "Clang: Enabled AddressSanitizer (ASan)")
|
||||
endif()
|
||||
|
||||
if(TSAN)
|
||||
target_compile_options(zm-compile-option-interface
|
||||
INTERFACE
|
||||
-fsanitize=thread)
|
||||
|
||||
target_link_options(zm-compile-option-interface
|
||||
INTERFACE
|
||||
-fsanitize=thread)
|
||||
|
||||
message(STATUS "Clang: Enabled ThreadSanitizer (TSan)")
|
||||
endif()
|
||||
|
|
|
@ -19,3 +19,15 @@ if(ASAN)
|
|||
|
||||
message(STATUS "GCC: Enabled AddressSanitizer (ASan)")
|
||||
endif()
|
||||
|
||||
if(TSAN)
|
||||
target_compile_options(zm-compile-option-interface
|
||||
INTERFACE
|
||||
-fsanitize=thread)
|
||||
|
||||
target_link_options(zm-compile-option-interface
|
||||
INTERFACE
|
||||
-fsanitize=thread)
|
||||
|
||||
message(STATUS "GCC: Enabled ThreadSanitizer (TSan)")
|
||||
endif()
|
||||
|
|
Loading…
Reference in New Issue