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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338119
91177308-0d34-0410-b5e6-
96231b3b80d8
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
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@)