[PATCH] D145228: [clangd] Add clangd headers to install targets

Ivan Murashko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 3 03:49:32 PST 2023


ivanmurashko created this revision.
ivanmurashko added reviewers: sammccall, alexfh, smeenai, aaron.ballman.
Herald added subscribers: kadircet, arphaman.
Herald added a project: All.
ivanmurashko requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.
Herald added a project: clang-tools-extra.

The install target for clang distributes the clangd static libs but missing corresponding headers. The diff adds necessary headers. That opens a possibility to create custom clangd builds outside LLVM repo.

Test Plan:

  ninja install-clangd-headers

see the headers installed at the install folder


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D145228

Files:
  clang-tools-extra/clangd/CMakeLists.txt


Index: clang-tools-extra/clangd/CMakeLists.txt
===================================================================
--- clang-tools-extra/clangd/CMakeLists.txt
+++ clang-tools-extra/clangd/CMakeLists.txt
@@ -218,3 +218,26 @@
 
 add_subdirectory(index/remote)
 add_subdirectory(index/dex/dexp)
+
+if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
+  install(DIRECTORY .
+    DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/clangd"
+    COMPONENT clangd-headers
+    FILES_MATCHING
+    PATTERN "*.h"
+    )
+  install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+    DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
+    COMPONENT clangd-headers
+    FILES_MATCHING
+    PATTERN "CMakeFiles" EXCLUDE
+    PATTERN "*.inc"
+    )
+  add_custom_target(clangd-headers)
+  set_target_properties(clangd-headers PROPERTIES FOLDER "Misc")
+  if(NOT LLVM_ENABLE_IDE)
+    add_llvm_install_targets(install-clangd-headers
+                             DEPENDS clangd-headers
+                             COMPONENT clangd-headers)
+  endif()
+endif()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145228.502093.patch
Type: text/x-patch
Size: 1005 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230303/e1a5df93/attachment-0001.bin>


More information about the cfe-commits mailing list