-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.rs
27 lines (22 loc) · 852 Bytes
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use std::path::Path;
fn main() -> Result<(), Box<dyn std::error::Error>> {
//intellij does not easily find types when not adding code to src
//tonic_build::compile_protos("proto/Flight.proto")?;
//tonic_build::compile_protos("proto/FlightSql.proto")?;
let out_dir = "./src";
let path = Path::new("./proto/Flight.proto");
if path.exists() {
println!("cargo:rerun-if-changed=./proto/Flight.proto");
tonic_build::configure()
.out_dir(out_dir)
.compile(&["proto/Flight.proto"], &["proto"])?;
}
let path = Path::new("./proto/FlightSql.proto");
if path.exists() {
println!("cargo:rerun-if-changed=./proto/FlightSql.proto");
tonic_build::configure()
.out_dir(out_dir)
.compile(&["proto/FlightSql.proto"], &["proto"])?;
}
Ok(())
}