1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

cmake: When using LLVM_DISTRIBUTION_COMPONENTS, adjust LLVMExports accordingly

This Makes sure we only export targets that we're distributing, since
cmake will fail to import the file otherwise due to missing targets.

llvm-svn: 286024
This commit is contained in:
Justin Bogner 2016-11-04 21:55:23 +00:00
parent 0981c01afa
commit f0c30875e0
2 changed files with 29 additions and 8 deletions

View File

@ -584,10 +584,15 @@ macro(add_llvm_library name)
set(install_type ARCHIVE)
endif()
if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
NOT LLVM_DISTRIBUTION_COMPONENTS)
set(export_to_llvmexports EXPORT LLVMExports)
endif()
install(TARGETS ${name}
EXPORT LLVMExports
${install_type} DESTINATION ${install_dir}
COMPONENT ${name})
${export_to_llvmexports}
${install_type} DESTINATION ${install_dir}
COMPONENT ${name})
if (NOT CMAKE_CONFIGURATION_TYPES)
add_custom_target(install-${name}
@ -618,10 +623,16 @@ macro(add_llvm_loadable_module name)
else()
set(dlldir "lib${LLVM_LIBDIR_SUFFIX}")
endif()
if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
NOT LLVM_DISTRIBUTION_COMPONENTS)
set(export_to_llvmexports EXPORT LLVMExports)
endif()
install(TARGETS ${name}
EXPORT LLVMExports
LIBRARY DESTINATION ${dlldir}
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
${export_to_llvmexports}
LIBRARY DESTINATION ${dlldir}
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
endif()
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
endif()
@ -797,8 +808,13 @@ macro(add_llvm_tool name)
if ( ${name} IN_LIST LLVM_TOOLCHAIN_TOOLS OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
if( LLVM_BUILD_TOOLS )
if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
NOT LLVM_DISTRIBUTION_COMPONENTS)
set(export_to_llvmexports EXPORT LLVMExports)
endif()
install(TARGETS ${name}
EXPORT LLVMExports
${export_to_llvmexports}
RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR}
COMPONENT ${name})

View File

@ -137,8 +137,13 @@ macro(add_tablegen target project)
endif()
if (${project} STREQUAL LLVM AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
if(${target} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
NOT LLVM_DISTRIBUTION_COMPONENTS)
set(export_to_llvmexports EXPORT LLVMExports)
endif()
install(TARGETS ${target}
EXPORT LLVMExports
${export_to_llvmexports}
RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR})
endif()
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${target})