//! Compiles the `.proto` files into one descriptor set the crate reads at run time. protox is a //! compiler in Rust, so building needs no `protoc` on the host or in the image. use prost::Message as _; fn main() { let files = ["proto/ipx.proto", "proto/directory.proto", "proto/play.proto"]; for f in files { println!("cargo:rerun-if-changed={f}"); } let set = protox::compile(files, ["proto"]).unwrap_or_else(|e| panic!("{e:?}")); let out = std::path::PathBuf::from(std::env::var("OUT_DIR").expect("cargo sets OUT_DIR")); std::fs::write(out.join("wire.bin"), set.encode_to_vec()).expect("writing the descriptor set"); }