|
|
|
@ -2,7 +2,7 @@ |
|
|
|
|
|
|
|
|
|
load("//:bazel/generate_cc.bzl", "generate_cc") |
|
|
|
|
|
|
|
|
|
def cc_grpc_library(name, srcs, deps, proto_only, use_external = False, **kwargs): |
|
|
|
|
def cc_grpc_library(name, srcs, deps, proto_only, well_known_protos, use_external = False, **kwargs): |
|
|
|
|
"""Generates C++ grpc classes from a .proto file. |
|
|
|
|
|
|
|
|
|
Assumes the generated classes will be used in cc_api_version = 2. |
|
|
|
@ -12,6 +12,9 @@ def cc_grpc_library(name, srcs, deps, proto_only, use_external = False, **kwargs |
|
|
|
|
srcs: a single proto_library, which wraps the .proto files with services. |
|
|
|
|
deps: a list of C++ proto_library (or cc_proto_library) which provides |
|
|
|
|
the compiled code of any message that the services depend on. |
|
|
|
|
well_known_protos: The target from protobuf library that exports well |
|
|
|
|
known protos. Currently it will only work if the value is |
|
|
|
|
"@submodule_protobuf//:well_known_protos" |
|
|
|
|
use_external: When True the grpc deps are prefixed with //external. This |
|
|
|
|
allows grpc to be used as a dependency in other bazel projects. |
|
|
|
|
**kwargs: rest of arguments, e.g., compatible_with and visibility. |
|
|
|
@ -35,6 +38,7 @@ def cc_grpc_library(name, srcs, deps, proto_only, use_external = False, **kwargs |
|
|
|
|
generate_cc( |
|
|
|
|
name = codegen_target, |
|
|
|
|
srcs = [proto_target], |
|
|
|
|
well_known_protos = well_known_protos, |
|
|
|
|
**kwargs |
|
|
|
|
) |
|
|
|
|
|
|
|
|
@ -49,6 +53,7 @@ def cc_grpc_library(name, srcs, deps, proto_only, use_external = False, **kwargs |
|
|
|
|
name = codegen_grpc_target, |
|
|
|
|
srcs = [proto_target], |
|
|
|
|
plugin = plugin, |
|
|
|
|
well_known_protos = well_known_protos, |
|
|
|
|
**kwargs |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|