blob: f9933c082dd53f8583463e4d7c36826788ddb8a4 [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"),
tags = kwargs.get("tags"),
)
PROTO_DEPS = [
"@com_google_protobuf//:protoc_lib",
]