Use cargo:rerun-if-changed to avoid recompiling protos (#160)
As @seanmonstar noticed, the build script will currently re-compile all the protobufs regardless of whether or not they have changed, making the build much slower. This PR modifies it to emit `cargo:rerun-if-changed=` for all the protobuf files, so they will only be regenerated if one of them changes. Signed-off-by: Eliza Weisman <eliza@buoyant.io>
This commit is contained in:
parent
1a386d1f1f
commit
3bbeac09d2
|
@ -24,4 +24,9 @@ fn build_control() {
|
||||||
.enable_server(true)
|
.enable_server(true)
|
||||||
.build(server_files, dirs)
|
.build(server_files, dirs)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
// recompile protobufs only if any of the proto files changes.
|
||||||
|
for file in client_files.iter().chain(server_files) {
|
||||||
|
println!("cargo:rerun-if-changed={}", file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue