fn main() {
generate_sfu_protocol();
}
fn generate_sfu_protocol() {
const INCLUDE_ROOT: &str = "proto";
const PROTOS: [&str; 3] = [
"video/sfu/models/models.proto",
"video/sfu/signal_rpc/signal.proto",
"video/sfu/event/events.proto",
];
println!("cargo:rerun-if-changed={INCLUDE_ROOT}");
for proto in PROTOS {
println!("cargo:rerun-if-changed={INCLUDE_ROOT}/{proto}");
}
let file_descriptors = protox::compile(PROTOS, [INCLUDE_ROOT])
.expect("protox failed to compile the vendored SFU .proto sources");
let mut config = prost_build::Config::new();
config.include_file("_sfu_proto.rs");
config
.compile_fds(file_descriptors)
.expect("prost-build failed to generate Rust types from the SFU descriptors");
}