extern crate bindgen;
extern crate cc;
use std::env;
use std::path::PathBuf;
fn main() {
println!("cargo:rustc-link-lib=raqm");
println!("cargo:rustc-link-lib=freetype2");
let bindings = bindgen::Builder::default()
.header("wrapper.h")
.clang_arg("-I/usr/include/freetype2/")
.whitelist_function("raqm_create")
.whitelist_function("raqm_destroy")
.whitelist_function("raqm_reference")
.whitelist_function("raqm_add_font_feature")
.whitelist_function("raqm_set_language")
.whitelist_function("raqm_set_par_direction")
.whitelist_function("raqm_set_text")
.whitelist_function("raqm_set_text_utf8")
.whitelist_function("raqm_set_freetype_face")
.whitelist_function("raqm_set_freetype_face_range")
.whitelist_function("raqm_set_freetype_load_flags")
.whitelist_function("raqm_add_font_feature")
.whitelist_function("raqm_layout")
.whitelist_function("raqm_get_glyphs")
.whitelist_function("raqm_index_to_position")
.whitelist_function("raqm_position_to_index")
.whitelist_type("raqm_t")
.whitelist_type("raqm_direction_t")
.whitelist_type("raqm_glyph_t")
.whitelist_type("_raqm")
.whitelist_recursively(false)
.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!");
}