[PATCH] D79085: [clangd] Add CMake dependencies for Protobuf-generated files

Kirill Bobyrev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 29 06:24:08 PDT 2020


kbobyrev created this revision.
kbobyrev added a reviewer: sammccall.
Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov, mgorny.
Herald added a project: clang.
kbobyrev added a comment.

Otherwise sources including `Index.pb.h` or `Index.grpc.pb.h` can be compiled before the those headers are generated.

https://github.com/kirillbobyrev/indexing-tools/runs/629305684 (disregard the mess in the repo)


Dependencies ensure that Protobufs are generated before all libraries
depending on the headers are **built**, not linked.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79085

Files:
  clang-tools-extra/clangd/index/remote/CMakeLists.txt
  clang-tools-extra/clangd/index/remote/marshalling/CMakeLists.txt
  clang-tools-extra/clangd/index/remote/server/CMakeLists.txt


Index: clang-tools-extra/clangd/index/remote/server/CMakeLists.txt
===================================================================
--- clang-tools-extra/clangd/index/remote/server/CMakeLists.txt
+++ clang-tools-extra/clangd/index/remote/server/CMakeLists.txt
@@ -14,3 +14,4 @@
 
   grpc++
   )
+add_dependencies(clangd-index-server RemoteIndexProtos)
Index: clang-tools-extra/clangd/index/remote/marshalling/CMakeLists.txt
===================================================================
--- clang-tools-extra/clangd/index/remote/marshalling/CMakeLists.txt
+++ clang-tools-extra/clangd/index/remote/marshalling/CMakeLists.txt
@@ -7,3 +7,4 @@
   protobuf
   clangDaemon
   )
+add_dependencies(clangdRemoteMarshalling RemoteIndexProtos)
Index: clang-tools-extra/clangd/index/remote/CMakeLists.txt
===================================================================
--- clang-tools-extra/clangd/index/remote/CMakeLists.txt
+++ clang-tools-extra/clangd/index/remote/CMakeLists.txt
@@ -19,6 +19,7 @@
     grpc++
     clangDaemon
     )
+  add_dependencies(clangdRemoteIndex RemoteIndexProtos)
 
   add_subdirectory(marshalling)
   add_subdirectory(server)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79085.260899.patch
Type: text/x-patch
Size: 1158 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200429/6683eee7/attachment.bin>


More information about the cfe-commits mailing list