use std::io::Result;
fn main() -> Result<()> {
#[cfg(feature = "vendored-protoc")]
std::env::set_var("PROTOC", protobuf_src::protoc());
let mut config = prost_build::Config::new();
config.skip_debug(["WidevinePsshData"])
.type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]")
.extern_path(
".google.protobuf.Any",
"::prost_wkt_types::Any")
.extern_path(
".google.protobuf.Timestamp",
"::prost_wkt_types::Timestamp")
.extern_path(
".google.protobuf.Value",
"::prost_wkt_types::Value");
#[cfg(feature = "protox")]
{
let file_descriptors = protox::compile(["src/widevine_pssh_data.proto"], &["src/"])
.expect("compiling protobuf with protox crate");
config.compile_fds(file_descriptors)
.expect("compiling protox-generated protobuf descriptors");
}
#[cfg(not(feature = "protox"))]
config.compile_protos(&["src/widevine_pssh_data.proto"], &["src/"])?;
Ok(())
}