mirror of
https://github.com/pinnacle-comp/pinnacle.git
synced 2024-12-27 21:58:18 +01:00
24 lines
666 B
Rust
24 lines
666 B
Rust
|
use std::path::PathBuf;
|
||
|
|
||
|
fn main() {
|
||
|
println!("cargo:rerun-if-changed=../../protocol");
|
||
|
|
||
|
let mut proto_paths = Vec::new();
|
||
|
|
||
|
for entry in walkdir::WalkDir::new("../../protocol") {
|
||
|
let entry = entry.unwrap();
|
||
|
|
||
|
if entry.file_type().is_file() && entry.path().extension().is_some_and(|ext| ext == "proto")
|
||
|
{
|
||
|
proto_paths.push(entry.into_path());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
let descriptor_path = PathBuf::from(std::env::var("OUT_DIR").unwrap()).join("lua-build.bin");
|
||
|
|
||
|
prost_build::Config::new()
|
||
|
.file_descriptor_set_path(descriptor_path)
|
||
|
.compile_protos(&proto_paths, &["../../protocol"])
|
||
|
.unwrap();
|
||
|
}
|