blob: e0eb606da92b2e1d4afd0d4bfdeced77ed303338 [file]
load("//cpp:cpp_proto_compile.bzl", "cpp_proto_compile")
def cpp_proto_library(**kwargs):
# Compile protos
name_pb = kwargs.get("name") + "_pb"
cpp_proto_compile(
name = name_pb,
**{k: v for (k, v) in kwargs.items() if k in ("deps", "verbose")} # Forward args
)
# Create cpp library
native.cc_library(
name = kwargs.get("name"),
srcs = [name_pb],
deps = PROTO_DEPS,
includes = [name_pb],
visibility = kwargs.get("visibility"),
)
PROTO_DEPS = [
"@com_google_protobuf//:protoc_lib",
]