-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.rs
More file actions
22 lines (21 loc) · 745 Bytes
/
Copy pathbuild.rs
File metadata and controls
22 lines (21 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
extern crate protoc_grpcio;
fn main() {
let protos = [
("p4runtime/proto", "p4/v1/p4runtime.proto"),
("p4runtime/proto", "p4/v1/p4data.proto"),
("p4runtime/proto", "p4/config/v1/p4info.proto"),
("p4runtime/proto", "p4/config/v1/p4types.proto"),
("googleapis", "google/rpc/status.proto"),
("googleapis", "google/rpc/code.proto"),
];
for proto in &protos {
println!("cargo:rerun-if-changed={}/{}", proto.0, proto.1);
}
protoc_grpcio::compile_grpc_protos(
&protos.iter().map(|x| x.1).collect::<Vec<&str>>(),
&protos.iter().map(|x| x.0).collect::<Vec<&str>>(),
"src/proto",
None,
)
.expect("Failed to compile gRPC definitions!");
}