summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Bradbury <asb@lowrisc.org>2017-12-13 09:02:13 +0000
committerAlex Bradbury <asb@lowrisc.org>2017-12-13 09:02:13 +0000
commitc35aae36d5d0228d1dca14290ddcee5933029f3b (patch)
tree84bfb5ab92a4add462f5eebba3e43a4d8767d37a
parent8111d3b89ccdc854a88113402f4eed935605d6f4 (diff)
downloadbcm5719-llvm-c35aae36d5d0228d1dca14290ddcee5933029f3b.tar.gz
bcm5719-llvm-c35aae36d5d0228d1dca14290ddcee5933029f3b.zip
[cmake] Fix host tools build in when LLVM_EXPERIMENTAL_TARGETS_TO_BUILD is set
r320413 triggered cmake configure failures when building with -DLLVM_OPTIMIZED_TABLEGEN=True and with LLVM_EXPERIMENTAL_TARGETS_TO_BUILD set (e.g. to RISCV). This is because that patch moved to passing through LLVM_TARGETS_TO_BUILD, and at that point LLVM_EXPERIMENTAL_TARGETS_TO_BUILD has been merged in to it. LLVM_EXPERIMENTAL_TARGETS_TO_BUILD must be also be passed through to avoid errors like below: -- Constructing LLVMBuild project information CMake Error at CMakeLists.txt:682 (message): The target `RISCV' does not exist. It should be one of AArch64;AMDGPU;ARM;BPF;Hexagon;Lanai;Mips;MSP430;NVPTX;PowerPC;Sparc;SystemZ;X86;XCore -- Configuring incomplete, errors occurred! See the thread http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20171211/509225.html for discussion of this fix. llvm-svn: 320556
-rw-r--r--llvm/cmake/modules/CrossCompile.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake
index 117eda77878..0ec76ead5c4 100644
--- a/llvm/cmake/modules/CrossCompile.cmake
+++ b/llvm/cmake/modules/CrossCompile.cmake
@@ -40,12 +40,15 @@ function(llvm_create_cross_target_internal target_name toolchain buildtype)
# them to spaces.
string(REPLACE ";" "$<SEMICOLON>" targets_to_build_arg
"${LLVM_TARGETS_TO_BUILD}")
+ string(REPLACE ";" "$<SEMICOLON>" experimental_targets_to_build_arg
+ "${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD}")
add_custom_command(OUTPUT ${LLVM_${target_name}_BUILD}/CMakeCache.txt
COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
${CROSS_TOOLCHAIN_FLAGS_${target_name}} ${CMAKE_SOURCE_DIR}
-DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE
-DLLVM_TARGETS_TO_BUILD="${targets_to_build_arg}"
+ -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${experimental_targets_to_build_arg}"
${build_type_flags} ${linker_flag} ${external_clang_dir}
WORKING_DIRECTORY ${LLVM_${target_name}_BUILD}
DEPENDS CREATE_LLVM_${target_name}
OpenPOWER on IntegriCloud