Skip to content

Commit 6d79a12

Browse files
jorge-ortegaLegNeato
authored andcommitted
Use bindgen::CargoCallback to rerun when included header files change.
1 parent ac7765d commit 6d79a12

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

crates/optix/build.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,9 @@ fn main() {
3333
fn bindgen_optix(optix_include: &Path, cuda_include: &Path) {
3434
let out_path = PathBuf::from(std::env::var("OUT_DIR").unwrap()).join("optix_wrapper.rs");
3535

36-
let header_path = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap())
37-
.join("src")
38-
.join("optix_wrapper.h");
39-
40-
println!("cargo:rerun-if-changed={}", header_path.display());
41-
4236
let bindings = bindgen::Builder::default()
4337
.header("src/optix_wrapper.h")
38+
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
4439
.clang_arg(format!("-I{}", optix_include.display()))
4540
.clang_arg(format!("-I{}", cuda_include.display()))
4641
.allowlist_recursively(false)

0 commit comments

Comments
 (0)