#[cfg(feature = "grpc-server")]
const PROTO_PATH: &str = "../proto/swhgraph.proto";
#[cfg(feature = "grpc-server")]
const PROTO_DIR: &str = "../proto/";
fn main() -> Result<(), Box<dyn std::error::Error>> {
#[cfg(feature = "grpc-server")]
{
let out_dir = std::env::var("OUT_DIR").expect("Missing OUT_DIR");
let out_dir = std::path::Path::new(&out_dir);
tonic_build::configure()
.file_descriptor_set_path(out_dir.join("swhgraph_descriptor.bin"))
.protoc_arg("--experimental_allow_proto3_optional") .compile(&[PROTO_PATH], &[PROTO_DIR])?;
}
Ok(())
}