aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2017-07-11 23:41:15 +0000
committerPetr Hosek <phosek@chromium.org>2017-07-11 23:41:15 +0000
commit39247cb1d13d71f7ab38d07b51b6784e97daf268 (patch)
treed1abb9bad9ff7997cbf8559364b0df6d4bf76451 /cmake
parent4aebf83110897f95aebb6945c7c7e7489c0779a8 (diff)
downloadllvm-39247cb1d13d71f7ab38d07b51b6784e97daf268.tar.gz
[CMake] Support multi-target runtimes build
This changes adds support for building runtimes for multiple different targets using LLVM runtimes directory. The implementation follow the model used already by the builtins build which already supports this option. To specify the runtimes targets to be built, use the LLVM_RUNTIME_TARGETS variable, where the valuae is the list of targets to build runtimes for. To pass a per target variable to the runtimes build, you can set RUNTIMES_<target>_<variable> where <variable> will be passed to the runtimes build for <target>. Each runtime target (except for the default one) will be installed into lib/<target> subdirectory. Build targets will be suffixed with the target name. Differential Revision: https://reviews.llvm.org/D32816 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307731 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/LLVMExternalProjectUtils.cmake10
1 files changed, 9 insertions, 1 deletions
diff --git a/cmake/modules/LLVMExternalProjectUtils.cmake b/cmake/modules/LLVMExternalProjectUtils.cmake
index d457389f3ca..c851eb8dbf0 100644
--- a/cmake/modules/LLVMExternalProjectUtils.cmake
+++ b/cmake/modules/LLVMExternalProjectUtils.cmake
@@ -195,8 +195,16 @@ function(llvm_ExternalProject_Add name source_dir)
# Add top-level targets
foreach(target ${ARG_EXTRA_TARGETS})
+ string(REPLACE ":" ";" target_list ${target})
+ list(GET target_list 0 target)
+ list(LENGTH target_list target_list_len)
+ if(${target_list_len} GREATER 1)
+ list(GET target_list 1 target_name)
+ else()
+ set(target_name "${target}")
+ endif()
llvm_ExternalProject_BuildCmd(build_runtime_cmd ${target} ${BINARY_DIR})
- add_custom_target(${target}
+ add_custom_target(${target_name}
COMMAND ${build_runtime_cmd}
DEPENDS ${name}-configure
WORKING_DIRECTORY ${BINARY_DIR}