This is motivated by https://reviews.llvm.org/D115852#3226050 where passing
`LLVM_USE_LINKER` in PASSTHROUGH_PREFIXES breaks cross-compilation
(e.g. targeting Windows on a Linux host). As suggested on that diff, implement
an override for it by allowing users to pass `RUNTIMES_${target}_LLVM_USE_LINKER`
to specify the linker for runtimes. Defaults to host linker if not specified.
Reviewed By: phosek, smeenai
Differential Revision: https://reviews.llvm.org/D131051
list(APPEND ${name}_extra_args -DLLVM_ENABLE_RUNTIMES=${LLVM_ENABLE_RUNTIMES_PASSTHROUGH})
endif()
+ if(NOT RUNTIMES_${name}_LLVM_USE_LINKER AND NOT RUNTIMES_${target}_LLVM_USE_LINKER)
+ list(APPEND ${name}_extra_args -DLLVM_USE_LINKER=${LLVM_USE_LINKER})
+ endif()
+
llvm_ExternalProject_Add(runtimes-${name}
${CMAKE_CURRENT_SOURCE_DIR}/../../runtimes
DEPENDS ${${name}_deps}
-DLLVM_RUNTIMES_TARGET=${name}
${COMMON_CMAKE_ARGS}
${${name}_extra_args}
- PASSTHROUGH_PREFIXES LLVM_USE_LINKER
EXTRA_TARGETS ${${name}_extra_targets}
${${name}_test_targets}
USE_TOOLCHAIN