summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt8
1 files changed, 6 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 715c61d..58443c0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,16 +1,20 @@
cmake_minimum_required(VERSION 3.5)
IF (UNIX)
- OPTION(ADD_ASAN "Use ASAN to show memory issues" FALSE)
OPTION(USE_CLANG "Use CLang" FALSE)
IF(USE_CLANG)
set(CMAKE_CXX_COMPILER "/usr/bin/clang++-3.8" CACHE string "clang++ compiler" FORCE)
ELSE()
set(CMAKE_CXX_COMPILER)
ENDIF()
+ OPTION(ADD_ASAN "Use ASAN to show memory issues" FALSE)
+ OPTION(ADD_TSAN "Use TSAN to show thread issues" FALSE)
IF(ADD_ASAN)
SET(EXTRA_LIBS ${EXTRA_LIBS} asan )
ADD_DEFINITIONS(-fsanitize=address -fno-omit-frame-pointer)
- # ADD_DEFINITIONS(-fsanitize=thread -fno-omit-frame-pointer -fPIE -pie -g)
+ ENDIF()
+ IF(ADD_TSAN)
+ SET(EXTRA_LIBS ${EXTRA_LIBS} tsan )
+ ADD_DEFINITIONS(-fsanitize=thread -fno-omit-frame-pointer -fPIE -pie -g)
ENDIF()
ENDIF()