2022-07-31 12:38:31 +00:00
|
|
|
#[cfg(feature = "unicode_support")]
|
|
|
|
use bindgen;
|
2022-07-31 10:52:00 +00:00
|
|
|
use std::env;
|
|
|
|
use std::path::PathBuf;
|
|
|
|
|
|
|
|
#[cfg(not(feature = "unicode_support"))]
|
2022-07-31 12:35:08 +00:00
|
|
|
fn main() {}
|
2022-07-31 10:52:00 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "unicode_support")]
|
|
|
|
fn main() {
|
|
|
|
println!("cargo:rustc-link-search=/usr/lib");
|
|
|
|
println!("cargo:rustc-link-lib=fontconfig");
|
|
|
|
println!("cargo:rerun-if-changed=src/bindgen_wrapper.h");
|
|
|
|
|
|
|
|
let bindings = bindgen::Builder::default()
|
|
|
|
.header("src/bindgen_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("unicode_support_bindings.rs"))
|
|
|
|
.expect("Couldn't write bindings");
|
|
|
|
}
|