[PATCH] D141047: build: with -DCLANGD_ENABLE_REMOTE=ON, search for grpc++ dependencies too

2023-01-12 Thread Sylvestre Ledru via Phabricator via cfe-commits
sylvestre.ledru added a comment.

thanks. reverting is fine :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141047

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D141047: build: with -DCLANGD_ENABLE_REMOTE=ON, search for grpc++ dependencies too

2023-01-12 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments.



Comment at: clang/cmake/modules/AddGRPC.cmake:7
   generate_proto_sources(ProtoSource ${ProtoFile} ${PROTO_UNPARSED_ARGUMENTS})
+  set(LINKED_GRPC_LIBRARIES protobuf gpr grpc grpc++)
 

Hi @sylvestre.ledru this seem to have broken clangd bots (also doesn't work for 
local dev environment anymore) 
https://lab.llvm.org/buildbot/#/builders/131/builds/38935 (buildbot was broken 
before that for a different reason).

I believe the issue is because you're looking for gpr/grpc only in the absence 
of target grpc++, but in other setups, e.g. the one used by buildbot and the 
only one supported in theory, that uses grpc build from sources. You can find a 
repro setup in details here 
https://github.com/clangd/clangd/blob/master/.github/workflows/autobuild.yaml#L206.
 Required configuration for LLVM looks like:
`cmake -G Ninja ../llvm/ -DCMAKE_BUILD_TYPE=RELEASE 
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DCLANGD_ENABLE_REMOTE=1 
-DGRPC_INSTALL_PATH=$HOME/.local` (assuming you run grpc installation to 
`$HOME/.local`).

I'll revert to unblock development (and to be able to investigate the other 
issue on the build bot).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141047

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D141047: build: with -DCLANGD_ENABLE_REMOTE=ON, search for grpc++ dependencies too

2023-01-10 Thread Sylvestre Ledru via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG9f3081dc6fe8: build: with -DCLANGD_ENABLE_REMOTE=ON, search 
for grpc++ dependencies too (authored by sylvestre.ledru).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141047

Files:
  clang/cmake/modules/AddGRPC.cmake
  cmake/Modules/FindGRPC.cmake


Index: cmake/Modules/FindGRPC.cmake
===
--- cmake/Modules/FindGRPC.cmake
+++ cmake/Modules/FindGRPC.cmake
@@ -82,11 +82,28 @@
 endif()
   endif()
   if(NOT TARGET grpc++)
+find_library(GPR_LIBRARY gpr ${GRPC_OPTS} REQUIRED)
+add_library(gpr UNKNOWN IMPORTED GLOBAL)
+message(STATUS "Using gpr: " ${GPR_LIBRARY})
+set_target_properties(gpr PROPERTIES IMPORTED_LOCATION ${GPR_LIBRARY})
+
 find_library(GRPC_LIBRARY grpc++ ${GRPC_OPTS} REQUIRED)
 add_library(grpc++ UNKNOWN IMPORTED GLOBAL)
 message(STATUS "Using grpc++: " ${GRPC_LIBRARY})
 set_target_properties(grpc++ PROPERTIES IMPORTED_LOCATION ${GRPC_LIBRARY})
 target_include_directories(grpc++ INTERFACE ${GRPC_INCLUDE_PATHS})
+find_library(GRPC2_LIBRARY grpc ${GRPC_OPTS} REQUIRED)
+add_library(grpc UNKNOWN IMPORTED GLOBAL)
+message(STATUS "Using grpc: " ${GRPC2_LIBRARY})
+set_target_properties(grpc PROPERTIES IMPORTED_LOCATION ${GRPC2_LIBRARY})
+
+find_library(ABSL_SYNCHRONIZATION_LIBRARY absl_synchronization 
${GRPC_OPTS} QUIET)
+if (ABSL_SYNCHRONIZATION_LIBRARY)
+  add_library(absl_synchronization UNKNOWN IMPORTED GLOBAL)
+  message(STATUS "Using absl_synchronization: " 
${ABSL_SYNCHRONIZATION_LIBRARY})
+  set_target_properties(absl_synchronization PROPERTIES IMPORTED_LOCATION 
${ABSL_SYNCHRONIZATION_LIBRARY})
+endif()
+
 if (ENABLE_GRPC_REFLECTION)
   find_library(GRPC_REFLECTION_LIBRARY grpc++_reflection ${GRPC_OPTS} 
REQUIRED)
   add_library(grpc++_reflection UNKNOWN IMPORTED GLOBAL)
Index: clang/cmake/modules/AddGRPC.cmake
===
--- clang/cmake/modules/AddGRPC.cmake
+++ clang/cmake/modules/AddGRPC.cmake
@@ -4,8 +4,13 @@
   # Take the first two args and forward the remaining to 
generate_proto_sources.
   cmake_parse_arguments(PARSE_ARGV 2 PROTO "" "" "")
   generate_proto_sources(ProtoSource ${ProtoFile} ${PROTO_UNPARSED_ARGUMENTS})
+  set(LINKED_GRPC_LIBRARIES protobuf gpr grpc grpc++)
 
+  if (ABSL_SYNCHRONIZATION_LIBRARY)
+list(APPEND LINKED_GRPC_LIBRARIES absl_synchronization)
+  endif()
   add_clang_library(${LibraryName} ${ProtoSource}
 PARTIAL_SOURCES_INTENDED
-LINK_LIBS PUBLIC grpc++ protobuf)
+LINK_LIBS PUBLIC  ${LINKED_GRPC_LIBRARIES})
+
 endfunction()


Index: cmake/Modules/FindGRPC.cmake
===
--- cmake/Modules/FindGRPC.cmake
+++ cmake/Modules/FindGRPC.cmake
@@ -82,11 +82,28 @@
 endif()
   endif()
   if(NOT TARGET grpc++)
+find_library(GPR_LIBRARY gpr ${GRPC_OPTS} REQUIRED)
+add_library(gpr UNKNOWN IMPORTED GLOBAL)
+message(STATUS "Using gpr: " ${GPR_LIBRARY})
+set_target_properties(gpr PROPERTIES IMPORTED_LOCATION ${GPR_LIBRARY})
+
 find_library(GRPC_LIBRARY grpc++ ${GRPC_OPTS} REQUIRED)
 add_library(grpc++ UNKNOWN IMPORTED GLOBAL)
 message(STATUS "Using grpc++: " ${GRPC_LIBRARY})
 set_target_properties(grpc++ PROPERTIES IMPORTED_LOCATION ${GRPC_LIBRARY})
 target_include_directories(grpc++ INTERFACE ${GRPC_INCLUDE_PATHS})
+find_library(GRPC2_LIBRARY grpc ${GRPC_OPTS} REQUIRED)
+add_library(grpc UNKNOWN IMPORTED GLOBAL)
+message(STATUS "Using grpc: " ${GRPC2_LIBRARY})
+set_target_properties(grpc PROPERTIES IMPORTED_LOCATION ${GRPC2_LIBRARY})
+
+find_library(ABSL_SYNCHRONIZATION_LIBRARY absl_synchronization ${GRPC_OPTS} QUIET)
+if (ABSL_SYNCHRONIZATION_LIBRARY)
+  add_library(absl_synchronization UNKNOWN IMPORTED GLOBAL)
+  message(STATUS "Using absl_synchronization: " ${ABSL_SYNCHRONIZATION_LIBRARY})
+  set_target_properties(absl_synchronization PROPERTIES IMPORTED_LOCATION ${ABSL_SYNCHRONIZATION_LIBRARY})
+endif()
+
 if (ENABLE_GRPC_REFLECTION)
   find_library(GRPC_REFLECTION_LIBRARY grpc++_reflection ${GRPC_OPTS} REQUIRED)
   add_library(grpc++_reflection UNKNOWN IMPORTED GLOBAL)
Index: clang/cmake/modules/AddGRPC.cmake
===
--- clang/cmake/modules/AddGRPC.cmake
+++ clang/cmake/modules/AddGRPC.cmake
@@ -4,8 +4,13 @@
   # Take the first two args and forward the remaining to generate_proto_sources.
   cmake_parse_arguments(PARSE_ARGV 2 PROTO "" "" "")
   generate_proto_sources(ProtoSource ${ProtoFile} ${PROTO_UNPARSED_ARGUMENTS})
+  set(LINKED_GRPC_LIBRARIES protobuf gpr grpc grpc++)
 
+  if (ABSL_SYNCHRONIZATION_LIBRARY)

[PATCH] D141047: build: with -DCLANGD_ENABLE_REMOTE=ON, search for grpc++ dependencies too

2023-01-10 Thread serge via Phabricator via cfe-commits
serge-sans-paille accepted this revision.
serge-sans-paille added a comment.
This revision is now accepted and ready to land.

LGTM, assuming, you actually tested that locally.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141047

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D141047: build: with -DCLANGD_ENABLE_REMOTE=ON, search for grpc++ dependencies too

2023-01-05 Thread Sylvestre Ledru via Phabricator via cfe-commits
sylvestre.ledru updated this revision to Diff 486546.
sylvestre.ledru added a comment.

add the missing {}


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141047

Files:
  clang/cmake/modules/AddGRPC.cmake
  cmake/Modules/FindGRPC.cmake


Index: cmake/Modules/FindGRPC.cmake
===
--- cmake/Modules/FindGRPC.cmake
+++ cmake/Modules/FindGRPC.cmake
@@ -82,11 +82,28 @@
 endif()
   endif()
   if(NOT TARGET grpc++)
+find_library(GPR_LIBRARY gpr ${GRPC_OPTS} REQUIRED)
+add_library(gpr UNKNOWN IMPORTED GLOBAL)
+message(STATUS "Using gpr: " ${GPR_LIBRARY})
+set_target_properties(gpr PROPERTIES IMPORTED_LOCATION ${GPR_LIBRARY})
+
 find_library(GRPC_LIBRARY grpc++ ${GRPC_OPTS} REQUIRED)
 add_library(grpc++ UNKNOWN IMPORTED GLOBAL)
 message(STATUS "Using grpc++: " ${GRPC_LIBRARY})
 set_target_properties(grpc++ PROPERTIES IMPORTED_LOCATION ${GRPC_LIBRARY})
 target_include_directories(grpc++ INTERFACE ${GRPC_INCLUDE_PATHS})
+find_library(GRPC2_LIBRARY grpc ${GRPC_OPTS} REQUIRED)
+add_library(grpc UNKNOWN IMPORTED GLOBAL)
+message(STATUS "Using grpc: " ${GRPC2_LIBRARY})
+set_target_properties(grpc PROPERTIES IMPORTED_LOCATION ${GRPC2_LIBRARY})
+
+find_library(ABSL_SYNCHRONIZATION_LIBRARY absl_synchronization 
${GRPC_OPTS} QUIET)
+if (ABSL_SYNCHRONIZATION_LIBRARY)
+  add_library(absl_synchronization UNKNOWN IMPORTED GLOBAL)
+  message(STATUS "Using absl_synchronization: " 
${ABSL_SYNCHRONIZATION_LIBRARY})
+  set_target_properties(absl_synchronization PROPERTIES IMPORTED_LOCATION 
${ABSL_SYNCHRONIZATION_LIBRARY})
+endif()
+
 if (ENABLE_GRPC_REFLECTION)
   find_library(GRPC_REFLECTION_LIBRARY grpc++_reflection ${GRPC_OPTS} 
REQUIRED)
   add_library(grpc++_reflection UNKNOWN IMPORTED GLOBAL)
Index: clang/cmake/modules/AddGRPC.cmake
===
--- clang/cmake/modules/AddGRPC.cmake
+++ clang/cmake/modules/AddGRPC.cmake
@@ -4,8 +4,13 @@
   # Take the first two args and forward the remaining to 
generate_proto_sources.
   cmake_parse_arguments(PARSE_ARGV 2 PROTO "" "" "")
   generate_proto_sources(ProtoSource ${ProtoFile} ${PROTO_UNPARSED_ARGUMENTS})
+  set(LINKED_GRPC_LIBRARIES protobuf gpr grpc grpc++)
 
+  if (ABSL_SYNCHRONIZATION_LIBRARY)
+list(APPEND LINKED_GRPC_LIBRARIES absl_synchronization)
+  endif()
   add_clang_library(${LibraryName} ${ProtoSource}
 PARTIAL_SOURCES_INTENDED
-LINK_LIBS PUBLIC grpc++ protobuf)
+LINK_LIBS PUBLIC  ${LINKED_GRPC_LIBRARIES})
+
 endfunction()


Index: cmake/Modules/FindGRPC.cmake
===
--- cmake/Modules/FindGRPC.cmake
+++ cmake/Modules/FindGRPC.cmake
@@ -82,11 +82,28 @@
 endif()
   endif()
   if(NOT TARGET grpc++)
+find_library(GPR_LIBRARY gpr ${GRPC_OPTS} REQUIRED)
+add_library(gpr UNKNOWN IMPORTED GLOBAL)
+message(STATUS "Using gpr: " ${GPR_LIBRARY})
+set_target_properties(gpr PROPERTIES IMPORTED_LOCATION ${GPR_LIBRARY})
+
 find_library(GRPC_LIBRARY grpc++ ${GRPC_OPTS} REQUIRED)
 add_library(grpc++ UNKNOWN IMPORTED GLOBAL)
 message(STATUS "Using grpc++: " ${GRPC_LIBRARY})
 set_target_properties(grpc++ PROPERTIES IMPORTED_LOCATION ${GRPC_LIBRARY})
 target_include_directories(grpc++ INTERFACE ${GRPC_INCLUDE_PATHS})
+find_library(GRPC2_LIBRARY grpc ${GRPC_OPTS} REQUIRED)
+add_library(grpc UNKNOWN IMPORTED GLOBAL)
+message(STATUS "Using grpc: " ${GRPC2_LIBRARY})
+set_target_properties(grpc PROPERTIES IMPORTED_LOCATION ${GRPC2_LIBRARY})
+
+find_library(ABSL_SYNCHRONIZATION_LIBRARY absl_synchronization ${GRPC_OPTS} QUIET)
+if (ABSL_SYNCHRONIZATION_LIBRARY)
+  add_library(absl_synchronization UNKNOWN IMPORTED GLOBAL)
+  message(STATUS "Using absl_synchronization: " ${ABSL_SYNCHRONIZATION_LIBRARY})
+  set_target_properties(absl_synchronization PROPERTIES IMPORTED_LOCATION ${ABSL_SYNCHRONIZATION_LIBRARY})
+endif()
+
 if (ENABLE_GRPC_REFLECTION)
   find_library(GRPC_REFLECTION_LIBRARY grpc++_reflection ${GRPC_OPTS} REQUIRED)
   add_library(grpc++_reflection UNKNOWN IMPORTED GLOBAL)
Index: clang/cmake/modules/AddGRPC.cmake
===
--- clang/cmake/modules/AddGRPC.cmake
+++ clang/cmake/modules/AddGRPC.cmake
@@ -4,8 +4,13 @@
   # Take the first two args and forward the remaining to generate_proto_sources.
   cmake_parse_arguments(PARSE_ARGV 2 PROTO "" "" "")
   generate_proto_sources(ProtoSource ${ProtoFile} ${PROTO_UNPARSED_ARGUMENTS})
+  set(LINKED_GRPC_LIBRARIES protobuf gpr grpc grpc++)
 
+  if (ABSL_SYNCHRONIZATION_LIBRARY)
+list(APPEND LINKED_GRPC_LIBRARIES absl_synchronization)
+  endif()
   add_clang_library(${LibraryName} ${ProtoSource}
 PARTIAL_SOURCES_INTENDED
-LIN

[PATCH] D141047: build: with -DCLANGD_ENABLE_REMOTE=ON, search for grpc++ dependencies too

2023-01-05 Thread serge via Phabricator via cfe-commits
serge-sans-paille added inline comments.



Comment at: cmake/Modules/FindGRPC.cmake:85
   if(NOT TARGET grpc++)
+find_library(GPR_LIBRARY gpr $GRPC_OPTS REQUIRED)
+add_library(gpr UNKNOWN IMPORTED GLOBAL)

Shouldn't this be `${GPRC_OPTS}`?



Comment at: cmake/Modules/FindGRPC.cmake:95
 target_include_directories(grpc++ INTERFACE ${GRPC_INCLUDE_PATHS})
+find_library(GRPC2_LIBRARY grpc $GRPC_OPTS REQUIRED)
+add_library(grpc UNKNOWN IMPORTED GLOBAL)

same here



Comment at: cmake/Modules/FindGRPC.cmake:100
+
+find_library(ABSL_SYNCHRONIZATION_LIBRARY absl_synchronization $GRPC_OPTS 
QUIET)
+if (ABSL_SYNCHRONIZATION_LIBRARY)

and here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141047

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D141047: build: with -DCLANGD_ENABLE_REMOTE=ON, search for grpc++ dependencies too

2023-01-05 Thread Sylvestre Ledru via Phabricator via cfe-commits
sylvestre.ledru created this revision.
sylvestre.ledru added a reviewer: serge-sans-paille.
Herald added subscribers: bmahjour, kadircet, arphaman.
Herald added a project: All.
sylvestre.ledru requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.
Herald added a project: clang.

Fixes: https://github.com/llvm/llvm-project/issues/59844


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141047

Files:
  clang/cmake/modules/AddGRPC.cmake
  cmake/Modules/FindGRPC.cmake


Index: cmake/Modules/FindGRPC.cmake
===
--- cmake/Modules/FindGRPC.cmake
+++ cmake/Modules/FindGRPC.cmake
@@ -82,11 +82,28 @@
 endif()
   endif()
   if(NOT TARGET grpc++)
+find_library(GPR_LIBRARY gpr $GRPC_OPTS REQUIRED)
+add_library(gpr UNKNOWN IMPORTED GLOBAL)
+message(STATUS "Using gpr: " ${GPR_LIBRARY})
+set_target_properties(gpr PROPERTIES IMPORTED_LOCATION ${GPR_LIBRARY})
+
 find_library(GRPC_LIBRARY grpc++ ${GRPC_OPTS} REQUIRED)
 add_library(grpc++ UNKNOWN IMPORTED GLOBAL)
 message(STATUS "Using grpc++: " ${GRPC_LIBRARY})
 set_target_properties(grpc++ PROPERTIES IMPORTED_LOCATION ${GRPC_LIBRARY})
 target_include_directories(grpc++ INTERFACE ${GRPC_INCLUDE_PATHS})
+find_library(GRPC2_LIBRARY grpc $GRPC_OPTS REQUIRED)
+add_library(grpc UNKNOWN IMPORTED GLOBAL)
+message(STATUS "Using grpc: " ${GRPC2_LIBRARY})
+set_target_properties(grpc PROPERTIES IMPORTED_LOCATION ${GRPC2_LIBRARY})
+
+find_library(ABSL_SYNCHRONIZATION_LIBRARY absl_synchronization $GRPC_OPTS 
QUIET)
+if (ABSL_SYNCHRONIZATION_LIBRARY)
+  add_library(absl_synchronization UNKNOWN IMPORTED GLOBAL)
+  message(STATUS "Using absl_synchronization: " 
${ABSL_SYNCHRONIZATION_LIBRARY})
+  set_target_properties(absl_synchronization PROPERTIES IMPORTED_LOCATION 
${ABSL_SYNCHRONIZATION_LIBRARY})
+endif()
+
 if (ENABLE_GRPC_REFLECTION)
   find_library(GRPC_REFLECTION_LIBRARY grpc++_reflection ${GRPC_OPTS} 
REQUIRED)
   add_library(grpc++_reflection UNKNOWN IMPORTED GLOBAL)
Index: clang/cmake/modules/AddGRPC.cmake
===
--- clang/cmake/modules/AddGRPC.cmake
+++ clang/cmake/modules/AddGRPC.cmake
@@ -4,8 +4,13 @@
   # Take the first two args and forward the remaining to 
generate_proto_sources.
   cmake_parse_arguments(PARSE_ARGV 2 PROTO "" "" "")
   generate_proto_sources(ProtoSource ${ProtoFile} ${PROTO_UNPARSED_ARGUMENTS})
+  set(LINKED_GRPC_LIBRARIES protobuf gpr grpc grpc++)
 
+  if (ABSL_SYNCHRONIZATION_LIBRARY)
+list(APPEND LINKED_GRPC_LIBRARIES absl_synchronization)
+  endif()
   add_clang_library(${LibraryName} ${ProtoSource}
 PARTIAL_SOURCES_INTENDED
-LINK_LIBS PUBLIC grpc++ protobuf)
+LINK_LIBS PUBLIC  ${LINKED_GRPC_LIBRARIES})
+
 endfunction()


Index: cmake/Modules/FindGRPC.cmake
===
--- cmake/Modules/FindGRPC.cmake
+++ cmake/Modules/FindGRPC.cmake
@@ -82,11 +82,28 @@
 endif()
   endif()
   if(NOT TARGET grpc++)
+find_library(GPR_LIBRARY gpr $GRPC_OPTS REQUIRED)
+add_library(gpr UNKNOWN IMPORTED GLOBAL)
+message(STATUS "Using gpr: " ${GPR_LIBRARY})
+set_target_properties(gpr PROPERTIES IMPORTED_LOCATION ${GPR_LIBRARY})
+
 find_library(GRPC_LIBRARY grpc++ ${GRPC_OPTS} REQUIRED)
 add_library(grpc++ UNKNOWN IMPORTED GLOBAL)
 message(STATUS "Using grpc++: " ${GRPC_LIBRARY})
 set_target_properties(grpc++ PROPERTIES IMPORTED_LOCATION ${GRPC_LIBRARY})
 target_include_directories(grpc++ INTERFACE ${GRPC_INCLUDE_PATHS})
+find_library(GRPC2_LIBRARY grpc $GRPC_OPTS REQUIRED)
+add_library(grpc UNKNOWN IMPORTED GLOBAL)
+message(STATUS "Using grpc: " ${GRPC2_LIBRARY})
+set_target_properties(grpc PROPERTIES IMPORTED_LOCATION ${GRPC2_LIBRARY})
+
+find_library(ABSL_SYNCHRONIZATION_LIBRARY absl_synchronization $GRPC_OPTS QUIET)
+if (ABSL_SYNCHRONIZATION_LIBRARY)
+  add_library(absl_synchronization UNKNOWN IMPORTED GLOBAL)
+  message(STATUS "Using absl_synchronization: " ${ABSL_SYNCHRONIZATION_LIBRARY})
+  set_target_properties(absl_synchronization PROPERTIES IMPORTED_LOCATION ${ABSL_SYNCHRONIZATION_LIBRARY})
+endif()
+
 if (ENABLE_GRPC_REFLECTION)
   find_library(GRPC_REFLECTION_LIBRARY grpc++_reflection ${GRPC_OPTS} REQUIRED)
   add_library(grpc++_reflection UNKNOWN IMPORTED GLOBAL)
Index: clang/cmake/modules/AddGRPC.cmake
===
--- clang/cmake/modules/AddGRPC.cmake
+++ clang/cmake/modules/AddGRPC.cmake
@@ -4,8 +4,13 @@
   # Take the first two args and forward the remaining to generate_proto_sources.
   cmake_parse_arguments(PARSE_ARGV 2 PROTO "" "" "")
   generate_proto_sources(ProtoSource ${ProtoFile} ${PROTO_UNPARSED_ARGUMENTS})
+  set(LINKED_GRPC_LIBRARIES protobuf gpr grpc grpc++)
 
+  i