1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00

[cmake] Pass external project source directories to sub-configures

We're passing LLVM_EXTERNAL_PROJECTS to cross-compilation configures, so
we also need to pass the source directories of those projects, otherwise
configuration can fail from not finding them.

Differential Revision: https://reviews.llvm.org/D69076

llvm-svn: 375157
This commit is contained in:
Shoaib Meenai 2019-10-17 19:24:58 +00:00
parent 4775d94534
commit 0e4637b7ff

View File

@ -1,3 +1,4 @@
include(AddLLVM)
include(LLVMExternalProjectUtils)
@ -57,6 +58,13 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype)
string(REPLACE ";" "$<SEMICOLON>" llvm_external_projects_arg
"${LLVM_EXTERNAL_PROJECTS}")
set(external_project_source_dirs)
foreach(project ${LLVM_EXTERNAL_PROJECTS})
canonicalize_tool_name(${project} name)
list(APPEND external_project_source_dirs
"-DLLVM_EXTERNAL_${name}_SOURCE_DIR=${LLVM_EXTERNAL_${name}_SOURCE_DIR}")
endforeach()
add_custom_command(OUTPUT ${${project_name}_${target_name}_BUILD}/CMakeCache.txt
COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
-DCMAKE_MAKE_PROGRAM="${CMAKE_MAKE_PROGRAM}"
@ -69,6 +77,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype)
-DLLVM_TARGET_ARCH="${LLVM_TARGET_ARCH}"
-DLLVM_ENABLE_PROJECTS="${llvm_enable_projects_arg}"
-DLLVM_EXTERNAL_PROJECTS="${llvm_external_projects_arg}"
${external_project_source_dirs}
-DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN="${LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN}"
${build_type_flags} ${linker_flag} ${external_clang_dir}
${ARGN}