mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
Support using "host" as a target in LLVM_TARGETS_TO_BUILD when using cmake.
llvm-svn: 184923
This commit is contained in:
parent
5c2b78684b
commit
d76c23149b
@ -137,18 +137,6 @@ set(LLVM_TARGETS_TO_BUILD
|
||||
${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD})
|
||||
list(REMOVE_DUPLICATES LLVM_TARGETS_TO_BUILD)
|
||||
|
||||
set(LLVM_ENUM_TARGETS "")
|
||||
foreach(c ${LLVM_TARGETS_TO_BUILD})
|
||||
list(FIND LLVM_ALL_TARGETS ${c} idx)
|
||||
list(FIND LLVM_EXPERIMENTAL_TARGETS_TO_BUILD ${c} idy)
|
||||
if( idx LESS 0 AND idy LESS 0 )
|
||||
message(FATAL_ERROR "The target `${c}' does not exist.
|
||||
It should be one of\n${LLVM_ALL_TARGETS}")
|
||||
else()
|
||||
set(LLVM_ENUM_TARGETS "${LLVM_ENUM_TARGETS}LLVM_TARGET(${c})\n")
|
||||
endif()
|
||||
endforeach(c)
|
||||
|
||||
set(llvm_builded_incs_dir ${LLVM_BINARY_DIR}/include/llvm)
|
||||
|
||||
include(AddLLVMDefinitions)
|
||||
@ -322,11 +310,22 @@ include(${LLVMBUILDCMAKEFRAG})
|
||||
|
||||
# Configure all of the various header file fragments LLVM uses which depend on
|
||||
# configuration variables.
|
||||
set(LLVM_ENUM_TARGETS "")
|
||||
set(LLVM_ENUM_ASM_PRINTERS "")
|
||||
set(LLVM_ENUM_ASM_PARSERS "")
|
||||
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()
|
||||
|
||||
file(GLOB asmp_file "${td}/*AsmPrinter.cpp")
|
||||
if( asmp_file )
|
||||
set(LLVM_ENUM_ASM_PRINTERS
|
||||
|
@ -384,6 +384,14 @@ else ()
|
||||
message(FATAL_ERROR "Unknown architecture ${LLVM_NATIVE_ARCH}")
|
||||
endif ()
|
||||
|
||||
# If build targets includes "host", then replace with native architecture.
|
||||
list(FIND LLVM_TARGETS_TO_BUILD "host" idx)
|
||||
if( NOT idx LESS 0 )
|
||||
list(REMOVE_AT LLVM_TARGETS_TO_BUILD ${idx})
|
||||
list(APPEND LLVM_TARGETS_TO_BUILD ${LLVM_NATIVE_ARCH})
|
||||
list(REMOVE_DUPLICATES LLVM_TARGETS_TO_BUILD)
|
||||
endif()
|
||||
|
||||
list(FIND LLVM_TARGETS_TO_BUILD ${LLVM_NATIVE_ARCH} NATIVE_ARCH_IDX)
|
||||
if (NATIVE_ARCH_IDX EQUAL -1)
|
||||
message(STATUS
|
||||
|
Loading…
x
Reference in New Issue
Block a user