[llvm] r338119 - [CMake] Followup for r337366: Only export LLVM_LINK_LLVM_DYLIB if it's set to ON

Philip Pfaffe via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 27 03:57:51 PDT 2018


Author: pfaffe
Date: Fri Jul 27 03:57:51 2018
New Revision: 338119

URL: http://llvm.org/viewvc/llvm-project?rev=338119&view=rev
Log:
[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

Modified:
    llvm/trunk/cmake/modules/CMakeLists.txt
    llvm/trunk/cmake/modules/LLVMConfig.cmake.in

Modified: llvm/trunk/cmake/modules/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/CMakeLists.txt?rev=338119&r1=338118&r2=338119&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/CMakeLists.txt (original)
+++ llvm/trunk/cmake/modules/CMakeLists.txt Fri Jul 27 03:57:51 2018
@@ -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

Modified: llvm/trunk/cmake/modules/LLVMConfig.cmake.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVMConfig.cmake.in?rev=338119&r1=338118&r2=338119&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/LLVMConfig.cmake.in (original)
+++ llvm/trunk/cmake/modules/LLVMConfig.cmake.in Fri Jul 27 03:57:51 2018
@@ -13,7 +13,7 @@ set(LLVM_COMMON_DEPENDS @LLVM_COMMON_DEP
 
 set(LLVM_AVAILABLE_LIBS @LLVM_AVAILABLE_LIBS@)
 
-set(LLVM_LINK_LLVM_DYLIB @LLVM_LINK_LLVM_DYLIB@)
+ at LLVM_CONFIG_LINK_LLVM_DYLIB@
 
 set(LLVM_DYLIB_COMPONENTS @LLVM_DYLIB_COMPONENTS@)
 




More information about the llvm-commits mailing list