AcheronSR/proto/build.rs

15 lines
405 B
Rust
Raw Normal View History

2024-04-15 23:27:08 +00:00
use std::path::Path;
2024-03-29 06:46:31 +00:00
pub fn main() {
let proto_file = "StarRail.proto";
2024-04-15 23:27:08 +00:00
if Path::new(proto_file).exists() {
2024-03-29 06:46:31 +00:00
println!("cargo:rerun-if-changed={proto_file}");
prost_build::Config::new()
.out_dir("out/")
.type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]")
2024-03-29 06:46:31 +00:00
.compile_protos(&[proto_file], &["."])
.unwrap();
}
}