summaryrefslogtreecommitdiff
path: root/lib/tsan/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-09-13 12:18:41 +0000
committerAlexey Samsonov <samsonov@google.com>2012-09-13 12:18:41 +0000
commit79c682624f727408c1e56afc9d561fe0e03f4804 (patch)
treeb6021eba3796577413a72728ed63821fb35d85fc /lib/tsan/CMakeLists.txt
parent2135d8a7f4ba30fe35ed02d5e6ffd59a95b26219 (diff)
downloadcompiler-rt-79c682624f727408c1e56afc9d561fe0e03f4804.tar.gz
compiler-rt-79c682624f727408c1e56afc9d561fe0e03f4804.tar.bz2
compiler-rt-79c682624f727408c1e56afc9d561fe0e03f4804.tar.xz
[TSan] Add initial support for buidling ThreadSanitizer runtime library with CMake (currently the only supported platfrom is 64-bit Linux). This patch makes 'clang++ -fthread-sanitizer' work for both clang in the build tree and installed clang
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@163789 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/tsan/CMakeLists.txt')
-rw-r--r--lib/tsan/CMakeLists.txt20
1 files changed, 15 insertions, 5 deletions
diff --git a/lib/tsan/CMakeLists.txt b/lib/tsan/CMakeLists.txt
index acfb854d..fc20cd88 100644
--- a/lib/tsan/CMakeLists.txt
+++ b/lib/tsan/CMakeLists.txt
@@ -1,8 +1,18 @@
-# Build for the AddressSanitizer runtime support library.
+# Build for the ThreadSanitizer runtime support library.
-file(GLOB TSAN_SOURCES "*.cc")
+include_directories(..)
-if(CAN_TARGET_X86_64)
- add_library(clang_rt.tsan-x86_64 STATIC ${TSAN_SOURCES})
- set_target_properties(clang_rt.tsan-x86_64 PROPERTIES COMPILE_FLAGS "${TARGET_X86_64_CFLAGS}")
+set(TSAN_CFLAGS ${SANITIZER_COMMON_CFLAGS})
+# FIXME: Add support for compile flags:
+# -Wframe-larger-than=512,
+# -Wglobal-constructors,
+# --sysroot=.
+
+if("${CMAKE_BUILD_TYPE}" EQUAL "Release")
+ set(TSAN_COMMON_DEFINITIONS DEBUG=0)
+else()
+ set(TSAN_COMMON_DEFINITIONS DEBUG=1)
endif()
+
+add_subdirectory(rtl)
+# FIXME: Support TSan runtime tests, unit tests and output tests.