[llvm] r268125 - [CMake] [Xcode] Improving Xcode toolchain generation to support distribution targets

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 29 15:19:35 PDT 2016


Author: cbieneman
Date: Fri Apr 29 17:19:35 2016
New Revision: 268125

URL: http://llvm.org/viewvc/llvm-project?rev=268125&view=rev
Log:
[CMake] [Xcode] Improving Xcode toolchain generation to support distribution targets

This adds a new target `install-distribution-toolchain` which will install an Xcode toolchain featuring just the LLVM components specified in LLVM_DISTRIBUTION_COMPONENTS.

Modified:
    llvm/trunk/tools/xcode-toolchain/CMakeLists.txt

Modified: llvm/trunk/tools/xcode-toolchain/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/xcode-toolchain/CMakeLists.txt?rev=268125&r1=268124&r2=268125&view=diff
==============================================================================
--- llvm/trunk/tools/xcode-toolchain/CMakeLists.txt (original)
+++ llvm/trunk/tools/xcode-toolchain/CMakeLists.txt Fri Apr 29 17:19:35 2016
@@ -70,3 +70,23 @@ add_custom_target(install-xcode-toolchai
                           -DCMAKE_INSTALL_PREFIX=${LLVMToolchainDir}/usr/
                           -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
                   ${cmake_3_2_USES_TERMINAL})
+
+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-toolchain
+                  DEPENDS ${LLVMToolchainDir}/ToolchainInfo.plist distribution)
+
+  foreach(target ${LLVM_DISTRIBUTION_COMPONENTS})
+    add_custom_target(install-distribution-${target}
+                DEPENDS ${target}
+                COMMAND "${CMAKE_COMMAND}"
+                        -DCMAKE_INSTALL_COMPONENT=${target}
+                        -DCMAKE_INSTALL_PREFIX=${LLVMToolchainDir}/usr/
+                        -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
+                ${cmake_3_2_USES_TERMINAL})
+    add_dependencies(install-distribution-toolchain install-distribution-${target})
+  endforeach()
+endif()




More information about the llvm-commits mailing list