[PATCH] D58269: [clang] Add build and install targets for clang libraries

Shoaib Meenai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 14 18:50:21 PST 2019


smeenai updated this revision to Diff 186957.
smeenai added a comment.

Fix condition


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58269/new/

https://reviews.llvm.org/D58269

Files:
  clang/CMakeLists.txt
  clang/cmake/modules/AddClang.cmake


Index: clang/cmake/modules/AddClang.cmake
===================================================================
--- clang/cmake/modules/AddClang.cmake
+++ clang/cmake/modules/AddClang.cmake
@@ -108,6 +108,8 @@
                                  DEPENDS ${name}
                                  COMPONENT ${name})
       endif()
+
+      set_property(GLOBAL APPEND PROPERTY CLANG_LIBS ${name})
     endif()
     set_property(GLOBAL APPEND PROPERTY CLANG_EXPORTS ${name})
   else()
Index: clang/CMakeLists.txt
===================================================================
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -543,6 +543,27 @@
   add_subdirectory(docs)
 endif()
 
+# Custom target to install all clang libraries.
+add_custom_target(clang-libraries)
+set_target_properties(clang-libraries PROPERTIES FOLDER "Misc")
+
+if(NOT CMAKE_CONFIGURATION_TYPES)
+  add_llvm_install_targets(install-clang-libraries
+                           DEPENDS clang-libraries
+                           COMPONENT clang-libraries)
+endif()
+
+get_property(CLANG_LIBS GLOBAL PROPERTY CLANG_LIBS)
+if(CLANG_LIBS)
+  list(REMOVE_DUPLICATES CLANG_LIBS)
+  foreach(lib ${CLANG_LIBS})
+    add_dependencies(clang-libraries ${lib})
+    if(NOT CMAKE_CONFIGURATION_TYPES)
+      add_dependencies(install-clang-libraries install-${lib})
+    endif()
+  endforeach()
+endif()
+
 add_subdirectory(cmake/modules)
 
 if(CLANG_STAGE)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58269.186957.patch
Type: text/x-patch
Size: 1417 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190215/0c990977/attachment-0001.bin>


More information about the cfe-commits mailing list