use std::env; use std::error::Error; use std::path::PathBuf; use bindgen::{CodegenConfig, MacroTypeVariation}; pub fn main() -> Result<(), Box> { println!("cargo:rerun-if-changed=gl.h"); let bindings = bindgen::Builder::default() .header("gl.h") .default_macro_constant_type(MacroTypeVariation::Signed) .with_codegen_config(CodegenConfig::all() & !CodegenConfig::FUNCTIONS) .allowlist_type("GL.*") .allowlist_type("_cl_.*") .allowlist_var("GL_.*") .blocklist_item("GL_Z4.*") .blocklist_item("GL_Z6.*") .generate()?; let out_path = PathBuf::from(env::var("OUT_DIR")?); bindings.write_to_file(out_path.join("bindings.rs"))?; Ok(()) }