summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2016-12-12 23:15:10 +0000
committerPetr Hosek <phosek@chromium.org>2016-12-12 23:15:10 +0000
commit024a17b06dadf94ebac3624891154eab3bf3eb6f (patch)
tree3ac4a21ae44f27ee5d57765341133529a812319e /llvm/cmake/modules
parent1a5e67869e5458065f6ecf500f22ee6024d95d28 (diff)
downloadbcm5719-llvm-024a17b06dadf94ebac3624891154eab3bf3eb6f.tar.gz
bcm5719-llvm-024a17b06dadf94ebac3624891154eab3bf3eb6f.zip
[CMake] Multi-target builtins build
This change enables building builtins for multiple different targets using LLVM runtimes directory. To specify the builtin targets to be built, use the LLVM_BUILTIN_TARGETS variable, where the value is the list of targets. To pass a per target variable to the builtin build, you can set BUILTINS_<target>_<variable> where <variable> will be passed to the builtin build for <target>. Differential Revision: https://reviews.llvm.org/D26652 llvm-svn: 289491
Diffstat (limited to 'llvm/cmake/modules')
-rw-r--r--llvm/cmake/modules/LLVMExternalProjectUtils.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/cmake/modules/LLVMExternalProjectUtils.cmake b/llvm/cmake/modules/LLVMExternalProjectUtils.cmake
index f7020fbc166..d457389f3ca 100644
--- a/llvm/cmake/modules/LLVMExternalProjectUtils.cmake
+++ b/llvm/cmake/modules/LLVMExternalProjectUtils.cmake
@@ -45,6 +45,9 @@ function(llvm_ExternalProject_Add name source_dir)
canonicalize_tool_name(${name} nameCanon)
if(NOT ARG_TOOLCHAIN_TOOLS)
set(ARG_TOOLCHAIN_TOOLS clang lld)
+ if(NOT APPLE AND NOT WIN32)
+ list(APPEND ARG_TOOLCHAIN_TOOLS llvm-ar llvm-ranlib)
+ endif()
endif()
foreach(tool ${ARG_TOOLCHAIN_TOOLS})
if(TARGET ${tool})
@@ -104,6 +107,12 @@ function(llvm_ExternalProject_Add name source_dir)
set(compiler_args -DCMAKE_C_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang
-DCMAKE_CXX_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++)
endif()
+ if(llvm-ar IN_LIST TOOLCHAIN_TOOLS)
+ list(APPEND compiler_args -DCMAKE_AR=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-ar)
+ endif()
+ if(llvm-ranlib IN_LIST TOOLCHAIN_TOOLS)
+ list(APPEND compiler_args -DCMAKE_RANLIB=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-ranlib)
+ endif()
list(APPEND ARG_DEPENDS ${TOOLCHAIN_TOOLS})
endif()
OpenPOWER on IntegriCloud