[PATCH] D41273: [cmake] Remove redundant check for Targets to build
Don Hinton via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 14 23:34:05 PST 2017
hintonda created this revision.
hintonda added reviewers: bogner, asb.
Herald added a subscriber: mgorny.
LLVM_TARGETS_TO_BUILD, which includes LLVM_EXPERIMENTAL_TARGETS_TO_BUILD,
is already checked by llvm-build, so this check is redundant. In
fact, if an invalid target is passed, llvm-build will catch it first
and exit, so this check will never run.
This check was added long before llvm-build, and when llvm-build was
added, it initially ran after this check. However, it was eventually
moved after llvm-build in r184923, which made it redundant.
https://reviews.llvm.org/D41273
Files:
CMakeLists.txt
cmake/modules/CrossCompile.cmake
Index: cmake/modules/CrossCompile.cmake
===================================================================
--- cmake/modules/CrossCompile.cmake
+++ cmake/modules/CrossCompile.cmake
@@ -40,15 +40,12 @@
# 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}
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -675,15 +675,7 @@
set(LLVM_ENUM_DISASSEMBLERS "")
foreach(t ${LLVM_TARGETS_TO_BUILD})
set( td ${LLVM_MAIN_SRC_DIR}/lib/Target/${t} )
-
- list(FIND LLVM_ALL_TARGETS ${t} idx)
- list(FIND LLVM_EXPERIMENTAL_TARGETS_TO_BUILD ${t} idy)
- if( idx LESS 0 AND idy LESS 0 )
- message(FATAL_ERROR "The target `${t}' does not exist.
- It should be one of\n${LLVM_ALL_TARGETS}")
- else()
- set(LLVM_ENUM_TARGETS "${LLVM_ENUM_TARGETS}LLVM_TARGET(${t})\n")
- endif()
+ set(LLVM_ENUM_TARGETS "${LLVM_ENUM_TARGETS}LLVM_TARGET(${t})\n")
file(GLOB asmp_file "${td}/*AsmPrinter.cpp")
if( asmp_file )
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41273.127069.patch
Type: text/x-patch
Size: 1730 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171215/ab70988e/attachment.bin>
More information about the llvm-commits
mailing list