summars/build.rs

10 lines
439 B
Rust

fn main() {
if std::env::var("CARGO_FEATURE_HOLD").is_ok() {
let protoc = protoc_bin_vendored::protoc_bin_path().unwrap();
unsafe { std::env::set_var("PROTOC", protoc) };
tonic_prost_build::configure()
.protoc_arg("--experimental_allow_proto3_optional")
.compile_protos(&["protos/hold.proto"], &["protos"])
.unwrap_or_else(|e| panic!("Could not build protos: {e}"));
}
}