brlapi-sys 0.3.0

Low-level FFI bindings for the BrlAPI library
// SPDX-License-Identifier: LGPL-2.1

//! A building script for bindgen.

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's poop these out to the output directory now.
    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.")
}