diff options
author | Petr Hosek <phosek@chromium.org> | 2018-01-08 23:50:59 +0000 |
---|---|---|
committer | Petr Hosek <phosek@chromium.org> | 2018-01-08 23:50:59 +0000 |
commit | f5a4b472011fc7d2d047e413db82235b297d2576 (patch) | |
tree | b3c56aac743b37abbfb40eed74ad570b7bd439f4 /runtimes | |
parent | 3e1ae868476d7a40791c24f8476407275470c35c (diff) |
[CMake] Support for cross-compilation when build runtimes
When cross-compiling, we cannot use the just built toolchain, instead
we need to use the host toolchain which we assume has a support for
targeting the selected target platform. We also need to pass the path
to the native version of llvm-config to external projects.
Differential Revision: https://reviews.llvm.org/D41678
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322046 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtimes')
-rw-r--r-- | runtimes/CMakeLists.txt | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt index 37939658168..c020b851bb9 100644 --- a/runtimes/CMakeLists.txt +++ b/runtimes/CMakeLists.txt @@ -354,6 +354,9 @@ else() # if this is included from LLVM's CMake CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off -DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS} -DLLVM_LIBRARY_DIR=${LLVM_LIBRARY_DIR} + -DCMAKE_C_COMPILER_TARGET=${TARGET_TRIPLE} + -DCMAKE_CXX_COMPILER_TARGET=${TARGET_TRIPLE} + -DCMAKE_ASM_COMPILER_TARGET=${TARGET_TRIPLE} -DCMAKE_C_COMPILER_WORKS=ON -DCMAKE_CXX_COMPILER_WORKS=ON -DCMAKE_ASM_COMPILER_WORKS=ON |