use std::path::PathBuf;
use std::{env, fs};
fn main() {
let out = PathBuf::from(env::var("OUT_DIR").unwrap());
let build = out.parent().unwrap().parent().unwrap().parent().unwrap();
let mut deps = fs::read_dir(build.join("deps")).unwrap();
let option = deps.find(|file| {
file.as_ref()
.unwrap()
.file_name()
.to_str()
.unwrap()
.contains("libhook")
});
match option {
Some(entry) => {
println!(
"cargo:rustc-link-lib=dylib={}",
entry.unwrap().path().to_str().unwrap()
);
}
None => println!("cargo:rustc-link-lib=dylib=hook"),
}
}