[PATCH] D44271: [CMake] Properly conditionalize installation of lld libraries

David Zarzycki via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 8 12:43:53 PST 2018


davezarzycki created this revision.
davezarzycki added a reviewer: labath.
Herald added a subscriber: mgorny.

In what appears to be a copy-and-paste error, lld currently only install libraries if the lld tools are configured to build.

Instead, lld should allow the libraries to be installed even if if the lld tools are not being built. Additionally, if users want to only install the tools and not the libraries, the LLVM way of doing that is by checking for follow LLVM_INSTALL_TOOLCHAIN_ONLY.

This fixes PR35960.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D44271

Files:
  cmake/modules/AddLLD.cmake


Index: cmake/modules/AddLLD.cmake
===================================================================
--- cmake/modules/AddLLD.cmake
+++ cmake/modules/AddLLD.cmake
@@ -10,7 +10,7 @@
   llvm_add_library(${name} ${ARG_ENABLE_SHARED} ${ARG_UNPARSED_ARGUMENTS})
   set_target_properties(${name} PROPERTIES FOLDER "lld libraries")
 
-  if (LLD_BUILD_TOOLS)
+  if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
     if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
         NOT LLVM_DISTRIBUTION_COMPONENTS)
       set(export_to_lldtargets EXPORT lldTargets)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44271.137639.patch
Type: text/x-patch
Size: 542 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180308/a720a81c/attachment.bin>


More information about the llvm-commits mailing list