#![allow( non_upper_case_globals, non_camel_case_types, non_snake_case, dead_code )] #![warn(unused_variables)] use std::{env, path::PathBuf}; pub fn main() { let library = pkg_config::probe_library("libpjproject") .expect("pjproject and pjproject-devel needs to be installed"); let bindings = bindgen::Builder::default() .clang_args( library .include_paths .iter() .map(|path| format!("-I{}", path.to_string_lossy())), ) .blocklist_item("FP_NAN") .blocklist_item("FP_INFINITE") .blocklist_item("FP_ZERO") .blocklist_item("FP_SUBNORMAL") .blocklist_item("FP_NORMAL") .blocklist_item("IPPORT_RESERVED") .header("wrapper.h") .parse_callbacks(Box::new(bindgen::CargoCallbacks)) .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!"); }