Wen 2d5496a564
Fix wen_restart proto compilation: (#33596)
* Fix wen_restart proto compilation:
- should recompile when proto changes
- no need for customization

* There is only one proto file, no need for loop.
2023-10-09 10:51:44 -07:00

20 lines
563 B
Rust

extern crate rustc_version;
use std::io::Result;
fn main() -> Result<()> {
const PROTOC_ENVAR: &str = "PROTOC";
if std::env::var(PROTOC_ENVAR).is_err() {
#[cfg(not(windows))]
std::env::set_var(PROTOC_ENVAR, protobuf_src::protoc());
}
let proto_base_path = std::path::PathBuf::from("proto");
let proto = proto_base_path.join("wen_restart.proto");
println!("cargo:rerun-if-changed={}", proto.display());
// Generate rust files from protos.
prost_build::compile_protos(&[proto], &[proto_base_path])?;
Ok(())
}