Skip to content
Snippets Groups Projects
Commit aec29e59 authored by Michael Gottesman's avatar Michael Gottesman
Browse files

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275006 91177308-0d34-0410-b5e6-96231b3b80d8
parent 56c01b37
No related branches found
No related tags found
No related merge requests found
...@@ -342,6 +342,9 @@ endif() ...@@ -342,6 +342,9 @@ endif()
add_definitions( -D_GNU_SOURCE ) add_definitions( -D_GNU_SOURCE )
option(CLANG_BUILD_TOOLS
"Build the Clang tools. If OFF, just generate build targets." ON)
option(CLANG_ENABLE_ARCMT "Build ARCMT." ON) option(CLANG_ENABLE_ARCMT "Build ARCMT." ON)
if (CLANG_ENABLE_ARCMT) if (CLANG_ENABLE_ARCMT)
set(ENABLE_CLANG_ARCMT "1") set(ENABLE_CLANG_ARCMT "1")
......
...@@ -121,17 +121,24 @@ macro(add_clang_executable name) ...@@ -121,17 +121,24 @@ macro(add_clang_executable name)
endmacro(add_clang_executable) endmacro(add_clang_executable)
macro(add_clang_tool name) macro(add_clang_tool name)
if (NOT CLANG_BUILD_TOOLS)
set(EXCLUDE_FROM_ALL ON)
endif()
add_clang_executable(${name} ${ARGN}) add_clang_executable(${name} ${ARGN})
install(TARGETS ${name}
RUNTIME DESTINATION bin if (CLANG_BUILD_TOOLS)
COMPONENT ${name}) install(TARGETS ${name}
RUNTIME DESTINATION bin
if(NOT CMAKE_CONFIGURATION_TYPES) COMPONENT ${name})
add_custom_target(install-${name}
DEPENDS ${name} if(NOT CMAKE_CONFIGURATION_TYPES)
COMMAND "${CMAKE_COMMAND}" add_custom_target(install-${name}
-DCMAKE_INSTALL_COMPONENT=${name} DEPENDS ${name}
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake") COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=${name}
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
endif()
endif() endif()
endmacro() endmacro()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment