When using LLVM_DISTRIBUTION_COMPONENTS, it's possible for clang'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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286210
91177308-0d34-0410-b5e6-
96231b3b80d8
if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
NOT LLVM_DISTRIBUTION_COMPONENTS)
set(export_to_clangtargets EXPORT ClangTargets)
+ set_property(GLOBAL PROPERTY CLANG_HAS_EXPORTS True)
endif()
install(TARGETS ${name}
if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
NOT LLVM_DISTRIBUTION_COMPONENTS)
set(export_to_clangtargets EXPORT ClangTargets)
+ set_property(GLOBAL PROPERTY CLANG_HAS_EXPORTS True)
endif()
install(TARGETS ${name}
set(CLANG_CONFIG_EXPORTS_FILE)
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
- install(EXPORT ClangTargets DESTINATION ${CLANG_INSTALL_PACKAGE_DIR})
+ get_property(clang_has_exports GLOBAL PROPERTY CLANG_HAS_EXPORTS)
+ if(clang_has_exports)
+ install(EXPORT ClangTargets DESTINATION ${CLANG_INSTALL_PACKAGE_DIR})
+ endif()
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/ClangConfig.cmake