// This file was generated by gir (https://github.com/gtk-rs/gir @ 11e59a0) // from gir-files (https://github.com/gtk-rs/gir-files @ cae49a8+) // DO NOT EDIT #[cfg(not(feature = "dox"))] extern crate pkg_config; #[cfg(not(feature = "dox"))] use pkg_config::{Config, Error}; #[cfg(not(feature = "dox"))] use std::env; #[cfg(not(feature = "dox"))] use std::io::prelude::*; #[cfg(not(feature = "dox"))] use std::io; #[cfg(not(feature = "dox"))] use std::process; #[cfg(feature = "dox")] fn main() {} // prevent linking libraries to avoid documentation failure #[cfg(not(feature = "dox"))] fn main() { if let Err(s) = find() { let _ = writeln!(io::stderr(), "{}", s); process::exit(1); } } #[cfg(not(feature = "dox"))] fn find() -> Result<(), Error> { let package_name = "appstream-glib"; let shared_libs = ["appstream-glib"]; let version = if cfg!(feature = "v0_7_15") { "0.7.15" } else if cfg!(feature = "v0_7_14") { "0.7.14" } else if cfg!(feature = "v0_7_11") { "0.7.11" } else if cfg!(feature = "v0_7_8") { "0.7.8" } else if cfg!(feature = "v0_7_7") { "0.7.7" } else if cfg!(feature = "v0_7_6") { "0.7.6" } else if cfg!(feature = "v0_7_5") { "0.7.5" } else if cfg!(feature = "v0_7_3") { "0.7.3" } else if cfg!(feature = "v0_7") { "0.7" } else if cfg!(feature = "v0_6_13") { "0.6.13" } else if cfg!(feature = "v0_6_9") { "0.6.9" } else if cfg!(feature = "v0_6_7") { "0.6.7" } else if cfg!(feature = "v0_6_6") { "0.6.6" } else if cfg!(feature = "v0_6_5") { "0.6.5" } else if cfg!(feature = "v0_6_4") { "0.6.4" } else if cfg!(feature = "v0_6_2") { "0.6.2" } else if cfg!(feature = "v0_6_1") { "0.6.1" } else if cfg!(feature = "v0_5_14") { "0.5.14" } else if cfg!(feature = "v0_5_13") { "0.5.13" } else if cfg!(feature = "v0_5_12") { "0.5.12" } else if cfg!(feature = "v0_5_11") { "0.5.11" } else if cfg!(feature = "v0_5_10") { "0.5.10" } else if cfg!(feature = "v0_5_8") { "0.5.8" } else if cfg!(feature = "v0_5_7") { "0.5.7" } else if cfg!(feature = "v0_5_6") { "0.5.6" } else if cfg!(feature = "v0_5_5") { "0.5.5" } else if cfg!(feature = "v0_5_2") { "0.5.2" } else if cfg!(feature = "v0_5_1") { "0.5.1" } else if cfg!(feature = "v0_5") { "0.5" } else if cfg!(feature = "v0_4_2") { "0.4.2" } else if cfg!(feature = "v0_4_1") { "0.4.1" } else if cfg!(feature = "v0_3_7") { "0.3.7" } else if cfg!(feature = "v0_3_5") { "0.3.5" } else if cfg!(feature = "v0_3_4") { "0.3.4" } else if cfg!(feature = "v0_3_2") { "0.3.2" } else if cfg!(feature = "v0_3_1") { "0.3.1" } else if cfg!(feature = "v0_3") { "0.3" } else if cfg!(feature = "v0_2_5") { "0.2.5" } else if cfg!(feature = "v0_2_4") { "0.2.4" } else if cfg!(feature = "v0_2_2") { "0.2.2" } else if cfg!(feature = "v0_2") { "0.2" } else if cfg!(feature = "v0_1_8") { "0.1.8" } else if cfg!(feature = "v0_1_7") { "0.1.7" } else if cfg!(feature = "v0_1_6") { "0.1.6" } else if cfg!(feature = "v0_1_5") { "0.1.5" } else if cfg!(feature = "v0_1_4") { "0.1.4" } else if cfg!(feature = "v0_1_3") { "0.1.3" } else if cfg!(feature = "v0_1_2") { "0.1.2" } else if cfg!(feature = "v0_1_1") { "0.1.1" } else { "0.1" }; if let Ok(inc_dir) = env::var("GTK_INCLUDE_DIR") { println!("cargo:include={}", inc_dir); } if let Ok(lib_dir) = env::var("GTK_LIB_DIR") { for lib_ in shared_libs.iter() { println!("cargo:rustc-link-lib=dylib={}", lib_); } println!("cargo:rustc-link-search=native={}", lib_dir); return Ok(()) } let target = env::var("TARGET").expect("TARGET environment variable doesn't exist"); let hardcode_shared_libs = target.contains("windows"); let mut config = Config::new(); config.atleast_version(version); config.print_system_libs(false); if hardcode_shared_libs { config.cargo_metadata(false); } match config.probe(package_name) { Ok(library) => { if let Ok(paths) = std::env::join_paths(library.include_paths) { println!("cargo:include={}", paths.to_string_lossy()); } if hardcode_shared_libs { for lib_ in shared_libs.iter() { println!("cargo:rustc-link-lib=dylib={}", lib_); } for path in library.link_paths.iter() { println!("cargo:rustc-link-search=native={}", path.to_str().expect("library path doesn't exist")); } } Ok(()) } Err(Error::EnvNoPkgConfig(_)) | Err(Error::Command { .. }) => { for lib_ in shared_libs.iter() { println!("cargo:rustc-link-lib=dylib={}", lib_); } Ok(()) } Err(err) => Err(err), } }