blob: e03048cf1746536ce2e725daea44a3212551479c [file] [log] [blame]
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
load("//cpp:cpp_grpc_compile.bzl", "cpp_grpc_compile")
def cpp_grpc_library(**kwargs):
name = kwargs.get("name")
deps = kwargs.get("deps")
visibility = kwargs.get("visibility")
name_pb = name + "_pb"
cpp_grpc_compile(
name = name_pb,
deps = deps,
visibility = visibility,
verbose = kwargs.pop("verbose", 0),
transitivity = kwargs.pop("transitivity", {}),
transitive = kwargs.pop("transitive", True),
)
native.cc_library(
name = name,
srcs = [name_pb],
deps = [
"//external:protobuf_clib",
"@com_github_grpc_grpc//:grpc++",
"@com_github_grpc_grpc//:grpc++_reflection",
],
includes = [name_pb],
visibility = visibility,
)