2022-07-31 12:38:31 +00:00
|
|
|
#[cfg(feature = "unicode_support")]
|
2022-07-31 10:52:00 +00:00
|
|
|
use std::env;
|
2022-08-01 04:37:13 +00:00
|
|
|
#[cfg(feature = "unicode_support")]
|
2022-07-31 10:52:00 +00:00
|
|
|
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")
|
2023-11-28 06:02:09 +00:00
|
|
|
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
|
2022-07-31 10:52:00 +00:00
|
|
|
.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");
|
|
|
|
}
|