[PATCH] D79387: [clangd] Fix remote index build for macOS with Homebrew-installed gRPC and Protobuf

Kirill Bobyrev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 19:23:04 PDT 2020


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

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79387

Files:
  llvm/cmake/modules/FindGRPC.cmake


Index: llvm/cmake/modules/FindGRPC.cmake
===================================================================
--- llvm/cmake/modules/FindGRPC.cmake
+++ llvm/cmake/modules/FindGRPC.cmake
@@ -21,6 +21,17 @@
 else()
   find_program(GRPC_CPP_PLUGIN grpc_cpp_plugin)
   find_program(PROTOC protoc)
+  if (${APPLE})
+    find_program(HOMEBREW brew)
+    execute_process(COMMAND ${HOMEBREW} --prefix grpc
+      OUTPUT_VARIABLE GRPC_HOMEBREW_PATH
+      OUTPUT_STRIP_TRAILING_WHITESPACE)
+    execute_process(COMMAND ${HOMEBREW} --prefix protobuf
+      OUTPUT_VARIABLE PROTOBUF_HOMEBREW_PATH
+      OUTPUT_STRIP_TRAILING_WHITESPACE)
+    include_directories(${GRPC_HOMEBREW_PATH}/include ${PROTOBUF_HOMEBREW_PATH}/include)
+    link_directories(${GRPC_HOMEBREW_PATH}/lib ${PROTOBUF_HOMEBREW_PATH}/lib)
+  endif()
 endif()
 
 # Proto headers are generated in ${CMAKE_CURRENT_BINARY_DIR}.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79387.261988.patch
Type: text/x-patch
Size: 880 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200505/014c617d/attachment.bin>


More information about the llvm-commits mailing list