summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-02-23 20:33:53 +0000
committerChris Bieneman <beanz@apple.com>2016-02-23 20:33:53 +0000
commitc90e12fe9fd7eb9fd7b342e7ac0cec971dd3e4db (patch)
tree78b008e98807bf3437827937cd44c30d948e1e48
parent5b21af5222229fa4ec40e1d7795352087276c1fa (diff)
downloadbcm5719-llvm-c90e12fe9fd7eb9fd7b342e7ac0cec971dd3e4db.tar.gz
bcm5719-llvm-c90e12fe9fd7eb9fd7b342e7ac0cec971dd3e4db.zip
[CMake] Create an install-distribution target driven by LLVM_DISTRIBUTION_COMPONENTS
The idea here is to provide a customizable install target that only depends on building the things you actually want to install. It relies on each component being installed having an auto-generated install-${component}, which in turn depends only on the target being installed. This is fundamentally a workaround for the fact that CMake generates build files which have their "install" target depend on the "all" target. This results in "ninja install" building a bunch of unneeded things. llvm-svn: 261681
-rw-r--r--llvm/CMakeLists.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 29eb0016840..3db1d275014 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -766,3 +766,20 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
endif()
endif()
+
+# This must be at the end of the LLVM root CMakeLists file because it must run
+# after all targets are created.
+if(LLVM_DISTRIBUTION_COMPONENTS)
+ if(CMAKE_CONFIGURATION_TYPES)
+ message(FATAL_ERROR "LLVM_DISTRIBUTION_COMPONENTS cannot be specified with multi-configuration generators (i.e. Xcode or Visual Studio)")
+ endif()
+
+ add_custom_target(install-distribution)
+ foreach(target ${LLVM_DISTRIBUTION_COMPONENTS})
+ if(TARGET install-${target})
+ add_dependencies(install-distribution install-${target})
+ else()
+ message(FATAL_ERROR "Specified distribution component '${target}' doesn't have an install target")
+ endif()
+ endforeach()
+endif()
OpenPOWER on IntegriCloud