1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

llvmbuildectomy - support disabled native target

This commit is contained in:
serge-sans-paille 2020-11-13 15:49:27 +01:00
parent bc1485d26a
commit 4616e3954c
2 changed files with 25 additions and 10 deletions

View File

@ -81,13 +81,21 @@ endfunction()
# Resolve cross-component dependencies, for each available component.
function(LLVMBuildResolveComponentsLink)
get_property(llvm_components GLOBAL PROPERTY LLVM_COMPONENT_LIBS)
get_property(llvm_has_jit_native TARGET ${LLVM_NATIVE_ARCH} PROPERTY LLVM_HAS_JIT)
# the native target may not be enabled when cross compiling
if(TARGET ${LLVM_NATIVE_ARCH})
get_property(llvm_has_jit_native TARGET ${LLVM_NATIVE_ARCH} PROPERTY LLVM_HAS_JIT)
else()
set(llvm_has_jit_native OFF)
endif()
if(llvm_has_jit_native)
set_property(TARGET Engine APPEND PROPERTY LLVM_LINK_COMPONENTS "MCJIT" "Native")
else()
set_property(TARGET Engine APPEND PROPERTY LLVM_LINK_COMPONENTS "Interpreter")
endif()
get_property(llvm_components GLOBAL PROPERTY LLVM_COMPONENT_LIBS)
foreach(llvm_component ${llvm_components})
get_property(link_components TARGET ${llvm_component} PROPERTY LLVM_LINK_COMPONENTS)
llvm_map_components_to_libnames(llvm_libs ${link_components})

View File

@ -1,13 +1,5 @@
include(LLVM-Build)
# Special components which don't have any source attached but aggregate other
# components
add_llvm_component_group(all-targets LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD})
add_llvm_component_group(Engine)
add_llvm_component_group(Native LINK_COMPONENTS ${LLVM_NATIVE_ARCH})
add_llvm_component_group(NativeCodeGen LINK_COMPONENTS ${LLVM_NATIVE_ARCH}CodeGen)
# `Demangle', `Support' and `TableGen' libraries are added on the top-level
# CMakeLists.txt
@ -50,5 +42,20 @@ add_subdirectory(WindowsManifest)
set(LLVMCONFIGLIBRARYDEPENDENCIESINC "${LLVM_BINARY_DIR}/tools/llvm-config/LibraryDependencies.inc")
# Special components which don't have any source attached but aggregate other
# components
add_llvm_component_group(all-targets LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD})
add_llvm_component_group(Engine)
# The native target may not be enabled when cross compiling
if(TARGET ${LLVM_NATIVE_ARCH})
add_llvm_component_group(Native LINK_COMPONENTS ${LLVM_NATIVE_ARCH})
add_llvm_component_group(NativeCodeGen LINK_COMPONENTS ${LLVM_NATIVE_ARCH}CodeGen)
else()
add_llvm_component_group(Native)
add_llvm_component_group(NativeCodeGen)
endif()
# Component post-processing
LLVMBuildResolveComponentsLink()
LLVMBuildGenerateCFragment(OUTPUT ${LLVMCONFIGLIBRARYDEPENDENCIESINC})