2021-08-27 17:27:48 +00:00
|
|
|
use std::env::VarError;
|
2021-12-13 22:25:26 +01:00
|
|
|
use std::{env, path::PathBuf};
|
2021-08-27 17:27:48 +00:00
|
|
|
|
|
|
|
fn main() -> Result<(), VarError> {
|
2021-12-13 22:25:26 +01:00
|
|
|
if cfg!(windows) {
|
2024-09-13 01:07:31 +02:00
|
|
|
println!("cargo:rustc-link-lib=dylib=amd_comgr_2");
|
2021-12-13 22:25:26 +01:00
|
|
|
let env = env::var("CARGO_CFG_TARGET_ENV")?;
|
|
|
|
if env == "msvc" {
|
|
|
|
let mut path = PathBuf::from(env::var("CARGO_MANIFEST_DIR")?);
|
|
|
|
path.push("lib");
|
|
|
|
println!("cargo:rustc-link-search=native={}", path.display());
|
|
|
|
} else {
|
|
|
|
println!("cargo:rustc-link-search=native=C:\\Windows\\System32");
|
|
|
|
};
|
|
|
|
} else {
|
2025-04-20 17:02:05 +02:00
|
|
|
println!("cargo:rustc-link-lib=dylib:+verbatim=libamd_comgr.so.2");
|
2024-09-13 01:07:31 +02:00
|
|
|
println!("cargo:rustc-link-search=native=/opt/rocm/lib/");
|
2021-12-13 22:25:26 +01:00
|
|
|
}
|
2021-08-27 17:27:48 +00:00
|
|
|
Ok(())
|
|
|
|
}
|