[compiler-rt] r247607 - [CMake] Add options to control building sanitizers and builtins.

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 14 12:59:24 PDT 2015


Author: cbieneman
Date: Mon Sep 14 14:59:24 2015
New Revision: 247607

URL: http://llvm.org/viewvc/llvm-project?rev=247607&view=rev
Log:
[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.

Modified:
    compiler-rt/trunk/CMakeLists.txt
    compiler-rt/trunk/lib/CMakeLists.txt

Modified: compiler-rt/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=247607&r1=247606&r2=247607&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Mon Sep 14 14:59:24 2015
@@ -43,6 +43,11 @@ endif()
 # Top level target used to build all compiler-rt libraries.
 add_custom_target(compiler-rt ALL)
 
+option(COMPILER_RT_BUILD_BUILTINS "Build builtins" ON)
+mark_as_advanced(COMPILER_RT_BUILD_BUILTINS)
+option(COMPILER_RT_BUILD_SANITIZERS "Build sanitizers" ON)
+mark_as_advanced(COMPILER_RT_BUILD_SANITIZERS)
+
 if (NOT COMPILER_RT_STANDALONE_BUILD)
   # Compute the Clang version from the LLVM version.
   # FIXME: We should be able to reuse CLANG_VERSION variable calculated

Modified: compiler-rt/trunk/lib/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/CMakeLists.txt?rev=247607&r1=247606&r2=247607&view=diff
==============================================================================
--- compiler-rt/trunk/lib/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/CMakeLists.txt Mon Sep 14 14:59:24 2015
@@ -4,40 +4,44 @@
 include(AddCompilerRT)
 include(SanitizerUtils)
 
-if(COMPILER_RT_HAS_INTERCEPTION)
-  add_subdirectory(interception)
+if(COMPILER_RT_BUILD_BUILTINS)
+  add_subdirectory(builtins)
 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_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()




More information about the llvm-commits mailing list