pinnacle/snowcap/snowcap-api-defs/build.rs
Ottatop a9d9a38e9d
Some checks failed
CI (Pinnacle) / Build (push) Has been cancelled
CI (Pinnacle) / Run tests (push) Has been cancelled
CI (Pinnacle) / Check formatting (push) Has been cancelled
CI (Pinnacle) / Clippy check (push) Has been cancelled
Build and Publish Lua Docs / Build (push) Has been cancelled
Build Rust Docs / Build docs (push) Has been cancelled
Bump non-smithay dependencies
2024-12-16 14:50:42 -06:00

23 lines
665 B
Rust

use std::path::PathBuf;
fn main() {
println!("cargo:rerun-if-changed=../api/protobuf");
let mut proto_paths = Vec::new();
for entry in walkdir::WalkDir::new("../api/protobuf") {
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("snowcap.bin");
tonic_build::configure()
.file_descriptor_set_path(descriptor_path)
.compile_protos(&proto_paths, &["../api/protobuf"])
.unwrap();
}