summaryrefslogtreecommitdiff
path: root/lib/CMakeLists.txt
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2015-09-14 19:59:24 +0000
committerChris Bieneman <beanz@apple.com>2015-09-14 19:59:24 +0000
commit0e0eb1961cb2297a653b4af1c806c158e951904c (patch)
tree7adb8b1104d381da88f5a259a1e1c490d877d657 /lib/CMakeLists.txt
parent52ac60869d85d687f37128246dee6567cc777147 (diff)
[CMake] Add options to control building sanitizers and builtins.
There are situations where a user may want to build only the compiler-rt builtins, or only the sanitizer runtimes. This exposes options to do that. Both default to On, so there should be no implicit change in behavior. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@247607 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CMakeLists.txt')
-rw-r--r--lib/CMakeLists.txt76
1 files changed, 40 insertions, 36 deletions
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index df0d9f483..fb5851aae 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -4,40 +4,44 @@
include(AddCompilerRT)
include(SanitizerUtils)
-if(COMPILER_RT_HAS_INTERCEPTION)
- add_subdirectory(interception)
-endif()
-
-if(COMPILER_RT_HAS_SANITIZER_COMMON)
- add_subdirectory(sanitizer_common)
- add_subdirectory(cfi)
- add_subdirectory(lsan)
- add_subdirectory(ubsan)
-endif()
-
-if(COMPILER_RT_HAS_ASAN)
- add_subdirectory(asan)
-endif()
-
-add_subdirectory(builtins)
-
-if(COMPILER_RT_HAS_DFSAN)
- add_subdirectory(dfsan)
-endif()
-
-if(COMPILER_RT_HAS_MSAN)
- add_subdirectory(msan)
-endif()
-
-if(COMPILER_RT_HAS_PROFILE)
- add_subdirectory(profile)
-endif()
-
-if(COMPILER_RT_HAS_TSAN)
- add_subdirectory(tsan)
- add_subdirectory(tsan/dd)
-endif()
-
-if(COMPILER_RT_HAS_SAFESTACK)
- add_subdirectory(safestack)
+if(COMPILER_RT_BUILD_BUILTINS)
+ add_subdirectory(builtins)
+endif()
+
+if(COMPILER_RT_BUILD_SANITIZERS)
+ if(COMPILER_RT_HAS_INTERCEPTION)
+ add_subdirectory(interception)
+ endif()
+
+ if(COMPILER_RT_HAS_SANITIZER_COMMON)
+ add_subdirectory(sanitizer_common)
+ add_subdirectory(cfi)
+ add_subdirectory(lsan)
+ add_subdirectory(ubsan)
+ endif()
+
+ if(COMPILER_RT_HAS_ASAN)
+ add_subdirectory(asan)
+ endif()
+
+ if(COMPILER_RT_HAS_DFSAN)
+ add_subdirectory(dfsan)
+ endif()
+
+ if(COMPILER_RT_HAS_MSAN)
+ add_subdirectory(msan)
+ endif()
+
+ if(COMPILER_RT_HAS_PROFILE)
+ add_subdirectory(profile)
+ endif()
+
+ if(COMPILER_RT_HAS_TSAN)
+ add_subdirectory(tsan)
+ add_subdirectory(tsan/dd)
+ endif()
+
+ if(COMPILER_RT_HAS_SAFESTACK)
+ add_subdirectory(safestack)
+ endif()
endif()