forked from vectordotdev/vector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.rs
18 lines (18 loc) · 829 Bytes
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
fn main() {
println!("cargo:rerun-if-changed=proto/event.proto");
println!("cargo:rerun-if-changed=proto/prometheus-remote.proto");
println!("cargo:rerun-if-changed=proto/prometheus-types.proto");
let mut prost_build = prost_build::Config::new();
prost_build.btree_map(&["."]);
// It would be nice to just add these derives to all the types, but
// prost automatically adds them already to enums, which causes the
// extra derives to conflict with itself.
prost_build.type_attribute(".prometheus.Label", "#[derive(Eq, Hash, Ord, PartialOrd)]");
prost_build
.compile_protos(
&["proto/event.proto", "proto/prometheus-remote.proto"],
&["proto/"],
)
.unwrap();
built::write_built_file().expect("Failed to acquire build-time information");
}