mpd_info_screen/build.rs

26 lines
792 B
Rust
Raw Normal View History

2022-07-31 12:38:31 +00:00
#[cfg(feature = "unicode_support")]
use std::env;
2022-08-01 04:37:13 +00:00
#[cfg(feature = "unicode_support")]
use std::path::PathBuf;
#[cfg(not(feature = "unicode_support"))]
fn main() {}
#[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::new()))
.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");
}