#[cfg(not(docsrs))]
use std::io;
#[cfg(not(docsrs))]
use std::io::prelude::*;
#[cfg(not(docsrs))]
use std::process;
#[cfg(docsrs)]
fn main() {}
#[cfg(not(docsrs))]
fn main() {
if let Err(s) = system_deps::Config::new().probe() {
let _ = writeln!(io::stderr(), "{s}");
process::exit(1);
}
check_features();
}
#[cfg(not(docsrs))]
fn check_features() {
const PKG_CONFIG_PACKAGE: &str = "gtk4";
if let Ok(targets) = pkg_config::get_variable(PKG_CONFIG_PACKAGE, "targets") {
println!("cargo:backends={targets}");
for target in targets.split_whitespace() {
println!(
"cargo:rustc-cfg=gdk_backend=\"{}\"",
target.trim_end_matches('\\')
);
}
}
}