extern crate cbindgen;

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

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

    if header_path.exists() {
        return;
    }

    cbindgen::Builder::new()
        .with_crate(crate_dir)
        .with_language(cbindgen::Language::C)
        .with_header("/* Generated by cbindgen */")
        .generate()
        .expect("Unable to generate bindings")
        .write_to_file(&header_path);
}
