diff --git a/llvm/cmake/modules/FindGRPC.cmake b/llvm/cmake/modules/FindGRPC.cmake --- a/llvm/cmake/modules/FindGRPC.cmake +++ b/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}.