extern crate bindgen; use { bindgen::{ Builder, CargoCallbacks, MacroTypeVariation, }, std::{ env, path::PathBuf, }, }; fn main() { println!("cargo:rerun-if-changed=wrapper.h"); let bindings = Builder::default() .header("wrapper.h") .parse_callbacks(Box::new(CargoCallbacks)) .default_macro_constant_type(MacroTypeVariation::Signed) .generate() .expect("Unable to generate bindings"); let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); bindings .write_to_file(out_path.join("bindings.rs")) .expect("Couldn't write bindings!"); }