Change build root folder String to a Path

This commit is contained in:
Feng94 2019-01-28 02:19:53 +11:00
parent 84a9dbf8e4
commit f218ab8a23
No known key found for this signature in database
GPG Key ID: 8373FCAC5D875CFD

View File

@ -1,8 +1,10 @@
extern crate protoc_grpcio;
use std::path::Path;
fn main() {
let proto_root = &format!("{}{}", "src", std::path::MAIN_SEPARATOR);
println!("cargo:rerun-if-changed={}", proto_root);
let proto_root = Path::new("src");
println!("cargo:rerun-if-changed={}", proto_root.display());
protoc_grpcio::compile_grpc_protos(&["services.proto"], &[proto_root], &proto_root)
.expect("Failed to compile gRPC definitions!");
}