forked from p4lang/p4runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.bazel
128 lines (110 loc) · 3.14 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
package(
default_visibility = ["//visibility:public"],
licenses = ["notice"], # Apache 2.0
)
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library")
load("@com_github_grpc_grpc//bazel:python_rules.bzl", "py_proto_library", "py_grpc_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
proto_library(
name = "p4types_proto",
srcs = ["p4/config/v1/p4types.proto"],
# TODO(github.com/grpc/grpc/issues/20675): strip_import_prefix breaks
# cc_grpc_library. Make proto folder the Bazel root folder as a workaround.
# strip_import_prefix = "proto",
)
proto_library(
name = "p4data_proto",
srcs = ["p4/v1/p4data.proto"],
# TODO(github.com/grpc/grpc/issues/20675): strip_import_prefix breaks
# cc_grpc_library. Make proto folder the Bazel root folder as a workaround.
# strip_import_prefix = "proto",
)
proto_library(
name = "p4info_proto",
srcs = ["p4/config/v1/p4info.proto"],
deps = [
":p4types_proto",
"@com_google_protobuf//:any_proto",
"@com_google_protobuf//:descriptor_proto",
],
# TODO(github.com/grpc/grpc/issues/20675): strip_import_prefix breaks
# cc_grpc_library. Make proto folder the Bazel root folder as a workaround.
# strip_import_prefix = "proto",
)
proto_library(
name = "p4runtime_proto",
srcs = ["p4/v1/p4runtime.proto"],
deps = [
":p4info_proto",
":p4data_proto",
"@com_google_protobuf//:any_proto",
"@com_google_googleapis//google/rpc:status_proto"
],
# TODO(github.com/grpc/grpc/issues/20675): strip_import_prefix brakes
# cc_grpc_library. Make proto folder the Bazel root folder as a workaround.
# strip_import_prefix = "proto",
)
cc_proto_library(
name = "p4types_cc_proto",
deps = [":p4types_proto"],
)
cc_proto_library(
name = "p4info_cc_proto",
deps = [":p4info_proto"],
)
cc_proto_library(
name = "p4data_cc_proto",
deps = [":p4data_proto"],
)
cc_proto_library(
name = "p4runtime_cc_proto",
deps = [":p4runtime_proto"],
)
py_proto_library(
name = "p4types_py_proto",
deps = [":p4types_proto"],
)
py_proto_library(
name = "p4info_py_proto",
deps = [":p4info_proto"],
)
py_proto_library(
name = "p4data_py_proto",
deps = [":p4data_proto"],
)
py_proto_library(
name = "p4runtime_py_proto",
deps = [":p4runtime_proto"],
)
go_proto_library(
name = "p4info_go_proto",
importpath = "github.com/p4lang/p4runtime/go/p4/config/v1",
protos = [
":p4info_proto",
":p4types_proto",
],
)
go_proto_library(
name = "p4runtime_go_proto",
importpath = "github.com/p4lang/p4runtime/go/p4/v1",
protos = [
":p4runtime_proto",
":p4data_proto",
],
deps = [
":p4info_go_proto",
"@com_google_googleapis//google/rpc:status_go_proto",
],
)
cc_grpc_library(
name = "p4runtime_cc_grpc",
grpc_only = True,
srcs = [":p4runtime_proto"],
deps = [":p4runtime_cc_proto"],
)
py_grpc_library(
name = "p4runtime_py_grpc",
srcs = [":p4runtime_proto"],
deps = [":p4runtime_py_proto"],
)