summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt3
-rw-r--r--cmake/modules/AddClang.cmake27
2 files changed, 20 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1a37b64aeb..cfcd2212cf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -342,6 +342,9 @@ endif()
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)
if (CLANG_ENABLE_ARCMT)
set(ENABLE_CLANG_ARCMT "1")
diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake
index 121ad29b50..6e063a706b 100644
--- a/cmake/modules/AddClang.cmake
+++ b/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()