-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathbuild.rs
More file actions
21 lines (19 loc) · 769 Bytes
/
build.rs
File metadata and controls
21 lines (19 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use vergen_git2::{Emitter, Git2Builder};
fn main() -> Result<(), Box<dyn std::error::Error>> {
// set VERGEN_GIT_SHA env variable based on git commit hash
let git2 = Git2Builder::default().branch(true).sha(true).build()?;
Emitter::default().add_instructions(&git2)?.emit()?;
tonic_prost_build::configure()
// enable optional fields
.protoc_arg("--experimental_allow_proto3_optional")
// compiling protos using path on build time
.compile_protos(
&[
"proto/wireguard/gateway.proto",
"proto/enterprise/firewall/firewall.proto",
],
&["proto/wireguard", "proto/enterprise/firewall"],
)?;
println!("cargo:rerun-if-changed=proto");
Ok(())
}