summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2016-11-08 05:02:18 +0000
committerJustin Bogner <mail@justinbogner.com>2016-11-08 05:02:18 +0000
commit80bee97477940a421c89fc832898369e4097355f (patch)
tree3592bba2fec7b8574dfecd478fad4af10eb8ce64 /llvm/cmake/modules
parentc5d7df90356b1b3d1e384220e34ba5cb87583829 (diff)
downloadbcm5719-llvm-80bee97477940a421c89fc832898369e4097355f.tar.gz
bcm5719-llvm-80bee97477940a421c89fc832898369e4097355f.zip
cmake: Don't try to install exports if there aren't any
When using LLVM_DISTRIBUTION_COMPONENTS, it's possible for LLVM's export list to be empty. If this happens the install(EXPORTS) command will fail, but since there isn't anything to install anyway we really just want to skip it. llvm-svn: 286209
Diffstat (limited to 'llvm/cmake/modules')
-rw-r--r--llvm/cmake/modules/AddLLVM.cmake3
-rw-r--r--llvm/cmake/modules/CMakeLists.txt7
2 files changed, 8 insertions, 2 deletions
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 11fa225ebf8..e8e119b2ad2 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -587,6 +587,7 @@ macro(add_llvm_library name)
if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
NOT LLVM_DISTRIBUTION_COMPONENTS)
set(export_to_llvmexports EXPORT LLVMExports)
+ set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True)
endif()
install(TARGETS ${name}
@@ -627,6 +628,7 @@ macro(add_llvm_loadable_module name)
if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
NOT LLVM_DISTRIBUTION_COMPONENTS)
set(export_to_llvmexports EXPORT LLVMExports)
+ set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True)
endif()
install(TARGETS ${name}
@@ -811,6 +813,7 @@ macro(add_llvm_tool name)
if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
NOT LLVM_DISTRIBUTION_COMPONENTS)
set(export_to_llvmexports EXPORT LLVMExports)
+ set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True)
endif()
install(TARGETS ${name}
diff --git a/llvm/cmake/modules/CMakeLists.txt b/llvm/cmake/modules/CMakeLists.txt
index 080c30e0db8..ac4b0b7c030 100644
--- a/llvm/cmake/modules/CMakeLists.txt
+++ b/llvm/cmake/modules/CMakeLists.txt
@@ -103,8 +103,11 @@ configure_file(
@ONLY)
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
- install(EXPORT LLVMExports DESTINATION ${LLVM_INSTALL_PACKAGE_DIR}
- COMPONENT cmake-exports)
+ get_property(llvm_has_exports GLOBAL PROPERTY LLVM_HAS_EXPORTS)
+ if(llvm_has_exports)
+ install(EXPORT LLVMExports DESTINATION ${LLVM_INSTALL_PACKAGE_DIR}
+ COMPONENT cmake-exports)
+ endif()
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/LLVMConfig.cmake
OpenPOWER on IntegriCloud