Skip to content

Commit

Permalink
Enhance BuildGRPCpp.cmake: update build command for Bazel, add byprod…
Browse files Browse the repository at this point in the history
…ucts and dependencies for protoc and grpc_cpp_plugin
  • Loading branch information
royshil committed Nov 27, 2024
1 parent b3ce695 commit fe2ad4f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmake/BuildGRPCpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ else()
GIT_PROGRESS TRUE
GIT_SUBMODULES_RECURSE ON
CONFIGURE_COMMAND ""
BUILD_COMMAND bazel build @com_google_protobuf//:protoc @com_github_grpc_grpc//src/compiler:grpc_cpp_plugin
BUILD_COMMAND "bazel build @com_google_protobuf//:protoc @com_github_grpc_grpc//src/compiler:grpc_cpp_plugin"
INSTALL_COMMAND ""
BUILD_BYPRODUCTS <SOURCE_DIR>/bazel-bin/external/com_google_protobuf/protoc
<SOURCE_DIR>/bazel-bin/src/compiler/grpc_cpp_plugin
BUILD_IN_SOURCE TRUE
LOG_DOWNLOAD ON
LOG_CONFIGURE ON
LOG_BUILD ON
Expand All @@ -62,6 +65,8 @@ else()
set(PROTOC_EXECUTABLE ${grpc_SOURCE_DIR}/bazel-bin/external/com_google_protobuf/protoc)
set(GRPC_PLUGIN_EXECUTABLE ${grpc_SOURCE_DIR}/bazel-bin/src/compiler/grpc_cpp_plugin)

add_dependencies(${CMAKE_PROJECT_NAME} grpc)

# make sure the protoc and grpc_cpp_plugin are found
find_program(
PROTOC_EXECUTABLE
Expand Down

0 comments on commit fe2ad4f

Please sign in to comment.