Skip to content

Commit c2b3f62

Browse files
committed
[cmake] Create exports for umbrella library targets
When using the umbrella llvm-libraries and clang-libraries targets, we should export all library targets, otherwise they'll be part of our distribution but not usable from the CMake package. Differential Revision: https://reviews.llvm.org/D58862 llvm-svn: 355354
1 parent e94add2 commit c2b3f62

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

clang/cmake/modules/AddClang.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ macro(add_clang_library name)
9191
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libclang")
9292

9393
if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
94+
"clang-libraries" IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
9495
NOT LLVM_DISTRIBUTION_COMPONENTS)
9596
set(export_to_clangtargets EXPORT ClangTargets)
9697
set_property(GLOBAL PROPERTY CLANG_HAS_EXPORTS True)

llvm/cmake/modules/AddLLVM.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,7 @@ macro(add_llvm_library name)
633633
# config file.
634634
if (NOT ARG_BUILDTREE_ONLY AND NOT ARG_MODULE)
635635
set_property( GLOBAL APPEND PROPERTY LLVM_LIBS ${name} )
636+
set(in_llvm_libs YES)
636637
endif()
637638

638639
if (ARG_MODULE AND NOT TARGET ${name})
@@ -663,6 +664,7 @@ macro(add_llvm_library name)
663664
endif()
664665

665666
if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
667+
(in_llvm_libs AND "llvm-libraries" IN_LIST LLVM_DISTRIBUTION_COMPONENTS) OR
666668
NOT LLVM_DISTRIBUTION_COMPONENTS)
667669
set(export_to_llvmexports EXPORT LLVMExports)
668670
set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True)

0 commit comments

Comments
 (0)