fn main() {
let csource = std::env::var("CARGO_FEATURE_CSOURCE").is_ok();
let wasm = std::env::var("CARGO_CFG_TARGET_ARCH")
.map(|a| a == "wasm32")
.unwrap_or(false);
if csource && !wasm {
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
let repo_root = std::path::Path::new(&manifest_dir)
.join("..") .join("..")
.canonicalize()
.expect("failed to resolve repo root");
let hyle_lib = repo_root.join("lib");
let qmap_lib = repo_root.join("../libqmap/lib");
println!("cargo:rustc-link-search=native={}", hyle_lib.display());
println!("cargo:rustc-link-search=native={}", qmap_lib.display());
println!("cargo:rustc-link-lib=static=hyle");
println!("cargo:rustc-link-lib=dylib=qmap");
println!("cargo:rustc-link-arg=-Wl,-rpath,{}", qmap_lib.display());
}
}