use std::{env, path::PathBuf};
extern crate bindgen;
fn main() {
println!("cargo:rustc-link-lib=brlapi");
let bindings = bindgen::Builder::default()
.header("wrapper.h")
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
.constified_enum_module("brlapi_rangeType_t")
.constified_enum_module("brlapi_error")
.use_core()
.generate()
.expect("Failed to generate bindings.");
let out_path = PathBuf::from(
env::var("OUT_DIR").expect("OUT_DIR environment variable should be set by cargo"),
);
bindings
.write_to_file(out_path.join("bindings.rs"))
.expect("Failed to write out the bindings.")
}