summaryrefslogtreecommitdiffstats
path: root/clang/cmake/modules
diff options
context:
space:
mode:
authorMichael Gottesman <mgottesman@apple.com>2016-07-10 01:44:00 +0000
committerMichael Gottesman <mgottesman@apple.com>2016-07-10 01:44:00 +0000
commiteb396a6cbf1e2ba0f1b8f48834fe13561b84e462 (patch)
tree2cc6aaa512168cf68cdf3f847f642abf27fb4145 /clang/cmake/modules
parent9ac6ae2a9921554e0c36b9fe7ae270f1dd4611a9 (diff)
downloadbcm5719-llvm-eb396a6cbf1e2ba0f1b8f48834fe13561b84e462.tar.gz
bcm5719-llvm-eb396a6cbf1e2ba0f1b8f48834fe13561b84e462.zip
Add CLANG_BUILD_TOOLS as a clang counterpart for LLVM_BUILD_TOOLS
LLVM_BUILD_TOOLS is a boolean variable that controls whether or not generated targets for llvm tools are built by the "all" target. CLANG_BUILD_TOOLS is an analogous variable for clang targets. This is useful functionality for selectively disabling the building of clang targets by default to speed up builds. In terms of implementation, I just followed the model of LLVM's implementation of this functionality. llvm-svn: 275006
Diffstat (limited to 'clang/cmake/modules')
-rw-r--r--clang/cmake/modules/AddClang.cmake27
1 files changed, 17 insertions, 10 deletions
diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake
index 121ad29b500..6e063a706bf 100644
--- a/clang/cmake/modules/AddClang.cmake
+++ b/clang/cmake/modules/AddClang.cmake
@@ -121,17 +121,24 @@ macro(add_clang_executable name)
endmacro(add_clang_executable)
macro(add_clang_tool name)
+ if (NOT CLANG_BUILD_TOOLS)
+ set(EXCLUDE_FROM_ALL ON)
+ endif()
+
add_clang_executable(${name} ${ARGN})
- install(TARGETS ${name}
- RUNTIME DESTINATION bin
- COMPONENT ${name})
-
- if(NOT CMAKE_CONFIGURATION_TYPES)
- add_custom_target(install-${name}
- DEPENDS ${name}
- COMMAND "${CMAKE_COMMAND}"
- -DCMAKE_INSTALL_COMPONENT=${name}
- -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+
+ if (CLANG_BUILD_TOOLS)
+ install(TARGETS ${name}
+ RUNTIME DESTINATION bin
+ COMPONENT ${name})
+
+ if(NOT CMAKE_CONFIGURATION_TYPES)
+ add_custom_target(install-${name}
+ DEPENDS ${name}
+ COMMAND "${CMAKE_COMMAND}"
+ -DCMAKE_INSTALL_COMPONENT=${name}
+ -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+ endif()
endif()
endmacro()
OpenPOWER on IntegriCloud