From c8f4a56750fc059f3a619c6b49db161bdab2953e Mon Sep 17 00:00:00 2001 From: Philip Pfaffe Date: Wed, 18 Jul 2018 08:53:31 +0000 Subject: [PATCH] [CMake] Export the LLVM_LINK_LLVM_DYLIB setting Summary: When building out-of-tree tools, there are several macros available to automate linking against llvm. An examples is `add_llvm_executable`, or the clang variant of this. These macros use the LLVM_LINK_LLVM_DYLIB option to decide whether to link against libraries defined by setting LLVM_LINK_COMPONENTS or to link against libLLVM instead. Currently this is problematic in out-of-tree targets, because they cannot identify whether this option is required or even available. If the option was enabled in LLVM's own build, the clang libraries are built against libLLVM, so a client linking against those must link against it too. On the other hand the client can't just always link against it, because it might not be available. This is related to D44391, but that change assumed the client knew whether they wanted the dylib or not. Reviewers: mgorny, beanz, labath Reviewed By: mgorny Subscribers: bollu, llvm-commits Differential Revision: https://reviews.llvm.org/D49193 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337366 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/modules/LLVMConfig.cmake.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/modules/LLVMConfig.cmake.in b/cmake/modules/LLVMConfig.cmake.in index 88918ba30c7..7a4f9e74c28 100644 --- a/cmake/modules/LLVMConfig.cmake.in +++ b/cmake/modules/LLVMConfig.cmake.in @@ -13,6 +13,8 @@ set(LLVM_COMMON_DEPENDS @LLVM_COMMON_DEPENDS@) set(LLVM_AVAILABLE_LIBS @LLVM_AVAILABLE_LIBS@) +set(LLVM_LINK_LLVM_DYLIB @LLVM_LINK_LLVM_DYLIB@) + set(LLVM_DYLIB_COMPONENTS @LLVM_DYLIB_COMPONENTS@) set(LLVM_ALL_TARGETS @LLVM_ALL_TARGETS@) -- 2.50.1