]> granicus.if.org Git - clang/commitdiff
[CMake] Make clang/tools subdirectories controlled via options
authorChris Bieneman <beanz@apple.com>
Tue, 20 Oct 2015 18:12:12 +0000 (18:12 +0000)
committerChris Bieneman <beanz@apple.com>
Tue, 20 Oct 2015 18:12:12 +0000 (18:12 +0000)
Setting CLANG_TOOL_*_BUILD=Off on the CMake command line will disable inclusion of a clang/tools subdirectory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250840 91177308-0d34-0410-b5e6-96231b3b80d8

CMakeLists.txt
tools/CMakeLists.txt

index 2adcea3231ec872d06292178f78c1cadf077e893..b956f4a68bb30890248ba878504a0bfee77ee802 100644 (file)
@@ -348,6 +348,10 @@ macro(set_clang_windows_version_resource_properties name)
   endif()
 endmacro()
 
+macro(add_clang_subdirectory name)
+  add_llvm_subdirectory(CLANG TOOL ${name})
+endmacro()
+
 macro(add_clang_library name)
   cmake_parse_arguments(ARG
     ""
index b2b2f6aa954c791223bd8e3bb0fac0a4711e0a83..891bf842db9efe288980282a5a52328d1a0d949f 100644 (file)
@@ -1,19 +1,21 @@
-add_subdirectory(diagtool)
-add_subdirectory(driver)
-add_subdirectory(clang-format)
-add_subdirectory(clang-format-vs)
-add_subdirectory(clang-fuzzer)
+create_subdirectory_options(CLANG TOOL)
 
-add_subdirectory(c-index-test)
-add_subdirectory(libclang)
+add_clang_subdirectory(diagtool)
+add_clang_subdirectory(driver)
+add_clang_subdirectory(clang-format)
+add_clang_subdirectory(clang-format-vs)
+add_clang_subdirectory(clang-fuzzer)
+
+add_clang_subdirectory(c-index-test)
+add_clang_subdirectory(libclang)
 
 if(CLANG_ENABLE_ARCMT)
-  add_subdirectory(arcmt-test)
-  add_subdirectory(c-arcmt-test)
+  add_clang_subdirectory(arcmt-test)
+  add_clang_subdirectory(c-arcmt-test)
 endif()
 
 if(CLANG_ENABLE_STATIC_ANALYZER)
-  add_subdirectory(clang-check)
+  add_clang_subdirectory(clang-check)
 endif()
 
 # We support checking out the clang-tools-extra repository into the 'extra'