From d35ffce5c0e21ffe2b8f3db888e4c9f9cf29283e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20M=C3=BCller?= Date: Mon, 16 Mar 2026 13:33:57 -0700 Subject: [PATCH] Re-run build script on src/bindings.rs change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- build.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.rs b/build.rs index 6105316..8db6895 100644 --- a/build.rs +++ b/build.rs @@ -57,6 +57,9 @@ fn generate_bindings(src_dir: path::PathBuf) { let out_dir = &path::PathBuf::from(env::var_os("OUT_DIR").expect("OUT_DIR should always be set")); + let out_file = out_dir.join("bindings.rs"); + println!("cargo:rerun-if-changed={}", out_file.display()); + bindgen::Builder::default() .rust_target(env!("CARGO_PKG_RUST_VERSION").parse().expect("valid")) .disable_header_comment() @@ -93,7 +96,7 @@ fn generate_bindings(src_dir: path::PathBuf) { )) .generate() .expect("Unable to generate bindings") - .write_to_file(out_dir.join("bindings.rs")) + .write_to_file(out_file) .expect("Couldn't write bindings"); }