Skip to content

Commit 4e694dd

Browse files
d-e-s-odanielocfb
authored andcommitted
Re-run build script on src/bindings.rs change
We should make sure to rerun the build script for generating the bindings when src/bindings.rs got changed externally. Signed-off-by: Daniel Müller <deso@posteo.net>
1 parent 7fd2489 commit 4e694dd

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

build.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ fn generate_bindings(src_dir: path::PathBuf) {
5757
let out_dir =
5858
&path::PathBuf::from(env::var_os("OUT_DIR").expect("OUT_DIR should always be set"));
5959

60+
let out_file = out_dir.join("bindings.rs");
61+
println!("cargo:rerun-if-changed={}", out_file.display());
62+
6063
bindgen::Builder::default()
6164
.rust_target(env!("CARGO_PKG_RUST_VERSION").parse().expect("valid"))
6265
.disable_header_comment()
@@ -93,7 +96,7 @@ fn generate_bindings(src_dir: path::PathBuf) {
9396
))
9497
.generate()
9598
.expect("Unable to generate bindings")
96-
.write_to_file(out_dir.join("bindings.rs"))
99+
.write_to_file(out_file)
97100
.expect("Couldn't write bindings");
98101
}
99102

0 commit comments

Comments
 (0)