[PATCH] D51603: [CMake] Provide a custom target to install LLVM libraries

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 3 14:19:19 PDT 2018


phosek created this revision.
phosek added a reviewer: beanz.
Herald added subscribers: llvm-commits, mgorny.

This simplifies installing all LLVM libraries when doing component
build; now you can include llvm-libraries in distribution components.


Repository:
  rL LLVM

https://reviews.llvm.org/D51603

Files:
  llvm/CMakeLists.txt


Index: llvm/CMakeLists.txt
===================================================================
--- llvm/CMakeLists.txt
+++ llvm/CMakeLists.txt
@@ -983,6 +983,27 @@
                              DEPENDS llvm-headers
                              COMPONENT llvm-headers)
   endif()
+
+  # Custom target to install all libraries.
+  add_custom_target(llvm-libraries)
+  set_target_properties(llvm-libraries PROPERTIES FOLDER "Misc")
+
+  if (NOT CMAKE_CONFIGURATION_TYPES)
+    add_llvm_install_targets(install-llvm-libraries
+                             DEPENDS llvm-libraries
+                             COMPONENT llvm-libraries)
+  endif()
+
+  get_property(LLVM_LIBS GLOBAL PROPERTY LLVM_LIBS)
+  if(LLVM_LIBS)
+    list(REMOVE_DUPLICATES LLVM_LIBS)
+    foreach(lib ${LLVM_LIBS})
+      add_dependencies(llvm-libraries ${lib})
+      if (NOT CMAKE_CONFIGURATION_TYPES)
+        add_dependencies(install-llvm-libraries install-${lib})
+      endif()
+    endforeach()
+  endif()
 endif()
 
 # This must be at the end of the LLVM root CMakeLists file because it must run


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51603.163748.patch
Type: text/x-patch
Size: 1074 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180903/59e7a647/attachment.bin>


More information about the llvm-commits mailing list