forked from rules-proto-grpc/rules_proto_grpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.bazel
42 lines (37 loc) · 1.31 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
load("//:plugin.bzl", "proto_plugin")
proto_plugin(
name = "rust_plugin",
# Use the proto basename and pipe the value to the rust_keyword function.
# Ths function will append '_pb' if the basename is a rust keyword.
outputs = ["{basename|rust_keyword}.rs"],
tool = "//rust/raze:cargo_bin_protoc_gen_rust",
exclusions = [
"google/protobuf",
],
visibility = ["//visibility:public"],
)
proto_plugin(
name = "grpc_rust_plugin",
# Use the proto basename and pipe the value to the rust_keyword function.
# Ths function will append '_pb' if the basename is a rust keyword.
outputs = ["{basename|rust_keyword}_grpc.rs"],
tool = "//rust/raze:cargo_bin_grpc_rust_plugin",
exclusions = [
"google/protobuf",
],
visibility = ["//visibility:public"],
)
# Bodge to allow linking against c-ares.
# The @com_github_cares_cares//:ares rule will output a .lo file that the rust rules don't know how
# to handle and therefore fails to link. See https://github.com/bazelbuild/rules_rust/issues/325
genrule(
name = "copy_ares",
srcs = ["@com_github_cares_cares//:ares"],
outs = ["libares.a"],
cmd = "cp $(location @com_github_cares_cares//:ares) \"$@\"",
)
cc_import(
name = "ares",
static_library = ":copy_ares",
visibility = ["//visibility:public"],
)