summaryrefslogtreecommitdiff
path: root/lib/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-09-02 08:57:23 +0000
committerAlexey Samsonov <samsonov@google.com>2013-09-02 08:57:23 +0000
commit642db076afad2d0c639e7adb25c6f0ed51536909 (patch)
tree080f4994e46ce51793e8e8887e9cb1513222211a /lib/CMakeLists.txt
parent717ece58e18190c4aef50bd16254db1d74036395 (diff)
[CMake] Don't build sanitizer runtimes if LLVM_USE_SANITIZER is specified
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189745 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CMakeLists.txt')
-rw-r--r--lib/CMakeLists.txt38
1 files changed, 21 insertions, 17 deletions
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index fbc6198d9..6aad76794 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -1,23 +1,27 @@
# First, add the subdirectories which contain feature-based runtime libraries
# and several convenience helper libraries.
-if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux|Windows")
- # AddressSanitizer is supported on Linux and Mac OS X.
- # Windows support is experimental.
- add_subdirectory(asan)
- add_subdirectory(interception)
- add_subdirectory(sanitizer_common)
- if(NOT ANDROID AND NOT MSVC)
- add_subdirectory(lsan)
- add_subdirectory(profile)
- add_subdirectory(ubsan)
+
+# Don't build sanitizers in the bootstrap build.
+if(LLVM_USE_SANITIZER STREQUAL "")
+ if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux|Windows")
+ # AddressSanitizer is supported on Linux and Mac OS X.
+ # Windows support is experimental.
+ add_subdirectory(asan)
+ add_subdirectory(interception)
+ add_subdirectory(sanitizer_common)
+ if(NOT ANDROID AND NOT MSVC)
+ add_subdirectory(lsan)
+ add_subdirectory(profile)
+ add_subdirectory(ubsan)
+ endif()
+ endif()
+ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND NOT ANDROID)
+ # ThreadSanitizer and MemorySanitizer are supported on Linux only.
+ add_subdirectory(tsan)
+ add_subdirectory(msan)
+ add_subdirectory(msandr)
+ add_subdirectory(dfsan)
endif()
-endif()
-if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND NOT ANDROID)
- # ThreadSanitizer and MemorySanitizer are supported on Linux only.
- add_subdirectory(tsan)
- add_subdirectory(msan)
- add_subdirectory(msandr)
- add_subdirectory(dfsan)
endif()
# The top-level lib directory contains a large amount of C code which provides