diff options
author | Justin Bogner <mail@justinbogner.com> | 2016-11-04 21:55:23 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2016-11-04 21:55:23 +0000 |
commit | 4ce3e0c31ad6e40ee744fb879eeed2d3f3d0162a (patch) | |
tree | 48f086790ea8892bbf2cb25b20bb6faca23904bb /llvm/cmake/modules | |
parent | 7c6d289d66dfc1c1b489783f1496623dadfe36a8 (diff) | |
download | bcm5719-llvm-4ce3e0c31ad6e40ee744fb879eeed2d3f3d0162a.tar.gz bcm5719-llvm-4ce3e0c31ad6e40ee744fb879eeed2d3f3d0162a.zip |
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
Diffstat (limited to 'llvm/cmake/modules')
-rw-r--r-- | llvm/cmake/modules/AddLLVM.cmake | 30 | ||||
-rw-r--r-- | llvm/cmake/modules/TableGen.cmake | 7 |
2 files changed, 29 insertions, 8 deletions
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index 238b8810f42..3dcbabe4d20 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -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}) diff --git a/llvm/cmake/modules/TableGen.cmake b/llvm/cmake/modules/TableGen.cmake index c9cfb37f8d2..a366299ab49 100644 --- a/llvm/cmake/modules/TableGen.cmake +++ b/llvm/cmake/modules/TableGen.cmake @@ -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}) |