diff options
author | Philip Pfaffe <philip.pfaffe@gmail.com> | 2018-07-27 10:57:51 +0000 |
---|---|---|
committer | Philip Pfaffe <philip.pfaffe@gmail.com> | 2018-07-27 10:57:51 +0000 |
commit | 5fed24a39698466952504850e8fd7703e17ce679 (patch) | |
tree | 5a61dfb50adc4092f4d53ad8352a52347b1d1d1b | |
parent | 78e4b4d3c442a8ee97f2488a7ec690146a42c6ac (diff) | |
download | bcm5719-llvm-5fed24a39698466952504850e8fd7703e17ce679.tar.gz bcm5719-llvm-5fed24a39698466952504850e8fd7703e17ce679.zip |
[CMake] Followup for r337366: Only export LLVM_LINK_LLVM_DYLIB if it's set to ON
Summary:
As it was, always exporting LLVM_LINK_LLVM_DYLIB caused out-of-tree
clients to lose the ability to link against the dylib, even if in-tree tools did
not. By only exporting the setting if it is enabled, out-of-tree clients get the
correct default, but may still choose if they can.
Reviewers: mgorny, beanz, labath, bogner, chandlerc
Reviewed By: bogner, chandlerc
Subscribers: bollu, llvm-commits
Differential Revision: https://reviews.llvm.org/D49843
llvm-svn: 338119
-rw-r--r-- | llvm/cmake/modules/CMakeLists.txt | 6 | ||||
-rw-r--r-- | llvm/cmake/modules/LLVMConfig.cmake.in | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/llvm/cmake/modules/CMakeLists.txt b/llvm/cmake/modules/CMakeLists.txt index 6074e835859..6c316a2f04f 100644 --- a/llvm/cmake/modules/CMakeLists.txt +++ b/llvm/cmake/modules/CMakeLists.txt @@ -47,6 +47,12 @@ set(LLVM_CONFIG_LIBRARY_DIRS set(LLVM_CONFIG_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") set(LLVM_CONFIG_BINARY_DIR "${LLVM_BINARY_DIR}") set(LLVM_CONFIG_TOOLS_BINARY_DIR "${LLVM_TOOLS_BINARY_DIR}") + +if (LLVM_LINK_LLVM_DYLIB) + set(LLVM_CONFIG_LINK_LLVM_DYLIB + "set(LLVM_LINK_LLVM_DYLIB ${LLVM_LINK_LLVM_DYLIB})") +endif() + # We need to use the full path to the LLVM Exports file to make sure we get the # one from the build tree. This is due to our cmake files being split between # this source dir and the binary dir in the build tree configuration and the diff --git a/llvm/cmake/modules/LLVMConfig.cmake.in b/llvm/cmake/modules/LLVMConfig.cmake.in index 7a4f9e74c28..8b4c22a3031 100644 --- a/llvm/cmake/modules/LLVMConfig.cmake.in +++ b/llvm/cmake/modules/LLVMConfig.cmake.in @@ -13,7 +13,7 @@ set(LLVM_COMMON_DEPENDS @LLVM_COMMON_DEPENDS@) set(LLVM_AVAILABLE_LIBS @LLVM_AVAILABLE_LIBS@) -set(LLVM_LINK_LLVM_DYLIB @LLVM_LINK_LLVM_DYLIB@) +@LLVM_CONFIG_LINK_LLVM_DYLIB@ set(LLVM_DYLIB_COMPONENTS @LLVM_DYLIB_COMPONENTS@) |