extern crate pkg_config; fn main() { std::env::set_current_dir("libvt100") .unwrap_or_else(|e| { panic!("failed to chdir: {}", e) }); let out = std::process::Command::new("make") .arg("static") .output() .unwrap_or_else(|e| { panic!("failed to exec: {}", e) }); if !out.status.success() { println!("{}", std::string::String::from_utf8_lossy(&out.stderr)); std::process::exit(out.status.code().unwrap_or(255)); } println!("cargo:rustc-link-search=native=libvt100"); println!("cargo:rustc-link-lib=static=vt100"); let lib_def = pkg_config::probe_library("glib-2.0") .unwrap_or_else(|e| { panic!("Couldn't find required dependency glib-2.0: {}", e); }); for dir in lib_def.link_paths { println!("cargo:rustc-link-search=native={:?}", dir); } for lib in lib_def.libs { println!("cargo:rustc-link-lib={}", lib); } }