From c2b3f62315f8243cba6b14c2ac6b0402f897819d Mon Sep 17 00:00:00 2001 From: Shoaib Meenai Date: Tue, 5 Mar 2019 00:38:32 +0000 Subject: [PATCH] [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 --- clang/cmake/modules/AddClang.cmake | 1 + llvm/cmake/modules/AddLLVM.cmake | 2 ++ 2 files changed, 3 insertions(+) diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake index 5ff2e8b13fa0..76ff6b1f152d 100644 --- a/clang/cmake/modules/AddClang.cmake +++ b/clang/cmake/modules/AddClang.cmake @@ -91,6 +91,7 @@ macro(add_clang_library name) if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libclang") if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR + "clang-libraries" IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR NOT LLVM_DISTRIBUTION_COMPONENTS) set(export_to_clangtargets EXPORT ClangTargets) set_property(GLOBAL PROPERTY CLANG_HAS_EXPORTS True) diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index 34327432bf7b..e722fbdc9323 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -633,6 +633,7 @@ macro(add_llvm_library name) # config file. if (NOT ARG_BUILDTREE_ONLY AND NOT ARG_MODULE) set_property( GLOBAL APPEND PROPERTY LLVM_LIBS ${name} ) + set(in_llvm_libs YES) endif() if (ARG_MODULE AND NOT TARGET ${name}) @@ -663,6 +664,7 @@ macro(add_llvm_library name) endif() if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR + (in_llvm_libs AND "llvm-libraries" IN_LIST LLVM_DISTRIBUTION_COMPONENTS) OR NOT LLVM_DISTRIBUTION_COMPONENTS) set(export_to_llvmexports EXPORT LLVMExports) set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True)