Files
termix/lib/build.rs
Nikolai Rodionov ce5669636a
Some checks failed
ci/woodpecker/push/code_tests Pipeline failed
ci/woodpecker/push/pre_commit_test Pipeline failed
Some WIP stuff
2025-12-15 09:28:20 +01:00

30 lines
1.2 KiB
Rust

use std::{env, fs, io::Result, path::PathBuf};
fn main() -> Result<()> {
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
//let proto_dir = "proto";
//let paths = fs::read_dir(proto_dir).unwrap();
//for path in paths {
// let path_str = path.unwrap().path().to_str().unwrap().to_string();
// let descriptor = format!("{}_descriptor.bin", path_str);
// tonic_prost_build::configure()
// .file_descriptor_set_path(out_dir.join("audio_backend_descriptor.bin"))
// .compile_protos(&["proto/audio_backend.proto"], &["proto"])
// .unwrap_or_else(|e| panic!("Failed to compile protos {:?}", e));
//}
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
tonic_prost_build::configure()
.file_descriptor_set_path(out_dir.join("audio_backend_descriptor.bin"))
.compile_protos(&["proto/audio_backend.proto"], &["proto"])
.unwrap_or_else(|e| panic!("Failed to compile protos {:?}", e));
tonic_prost_build::configure()
.file_descriptor_set_path(out_dir.join("track_descriptor.bin"))
.compile_protos(&["proto/track.proto"], &["proto"])
.unwrap_or_else(|e| panic!("Failed to compile protos {:?}", e));
Ok(())
}