summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-02-06 16:07:33 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2017-03-11 15:41:44 +0100
commit2781c2ed38d778c5bfd258678163949f3593a3e7 (patch)
tree4290f8c180ed408af73d8c778d19e1976e10e71a
parent166b2e39f3815216871c0f505e9d879e11ca5080 (diff)
downloadlibnitrokey-2781c2ed38d778c5bfd258678163949f3593a3e7.tar.gz
libnitrokey-2781c2ed38d778c5bfd258678163949f3593a3e7.tar.bz2
Support TSAN
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-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()