ZLUDA/ext/hip_runtime-sys/build.rs

21 lines
714 B
Rust
Raw Normal View History

2021-08-27 17:27:48 +00:00
use std::env::VarError;
use std::{env, path::PathBuf};
2021-08-27 17:27:48 +00:00
fn main() -> Result<(), VarError> {
if cfg!(windows) {
println!("cargo:rustc-link-lib=dylib=amdhip64_6");
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 {
println!("cargo:rustc-link-lib=dylib:+verbatim=libamdhip64.so.6");
println!("cargo:rustc-link-search=native=/opt/rocm/lib/");
}
2021-08-27 17:27:48 +00:00
Ok(())
}