fn main() { println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rerun-if-changed=wrapper.h"); println!("cargo:rustc-link-lib=dwf"); let out_path = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap()); bindgen::Builder::default() .header("wrapper.h") .parse_callbacks(Box::new(bindgen::CargoCallbacks)) .generate_comments(false) .array_pointers_in_arguments(true) .generate() .expect("Unable to generate bindings") .write_to_file(out_path.join("bindings.rs")) .expect("Couldn't write bindings!"); }