extern crate metadeps;
extern crate bindgen;
use std::{
env,
path::PathBuf,
};
fn main() {
if metadeps::probe().unwrap().get("zbar").unwrap().version.parse::<f64>().unwrap() >= 0.2 {
if cfg!(feature = "zbar_fork_if_available") {
println!("cargo:rustc-cfg=feature=\"zbar_fork\"");
}
}
let bindings = bindgen::Builder::default()
.header("wrapper.h")
.rustified_enum(".*")
.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!");
}