use cbindgen;
use std::env;
use std::path::PathBuf;

fn main() {
    let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
    let out_path = PathBuf::from(&crate_dir).join("include").join("roselib.h");

    cbindgen::Builder::new()
        .with_crate(crate_dir)
        .with_namespace("Rose")
        .with_parse_deps(true)
        .with_parse_include(&["roselib"])
        .with_autogen_warning(
            "/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */",
        )
        .generate()
        .expect("Unable to generate bindings")
        .write_to_file(out_path);
}
