aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2015-11-13 14:06:35 +0100
committerPierre Ossman <ossman@cendio.se>2015-11-27 11:11:22 +0100
commitb74728f9d653ece2d25f26aa563f7e5ecbdc4023 (patch)
tree98fede32546a3905f04c9b69cdea788a88d4305d /CMakeLists.txt
parentbf431a6b980f80d74463afbc60a3de3ce95dd5b5 (diff)
downloadtigervnc-b74728f9d653ece2d25f26aa563f7e5ecbdc4023.tar.gz
tigervnc-b74728f9d653ece2d25f26aa563f7e5ecbdc4023.zip
Add option to enable thread sanitizer
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7fb7b1e6..f2e7d50e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -80,6 +80,12 @@ if(ENABLE_ASAN AND NOT WIN32 AND NOT APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
endif()
+option(ENABLE_TSAN "Enable thread sanitizer support" OFF)
+if(ENABLE_TSAN AND NOT WIN32 AND NOT APPLE AND CMAKE_SIZEOF_VOID_P MATCHES 8)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=thread")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread")
+endif()
+
if(NOT DEFINED BUILD_WINVNC)
set(BUILD_WINVNC 1)
endif()