d7714d84c0
* Add support of ROCm 6.1.2 for Windows. * Fix CI. * Use llvm.sqrt.f64.
20 lines
623 B
Rust
20 lines
623 B
Rust
use std::env::VarError;
|
|
use std::{env, path::PathBuf};
|
|
|
|
fn main() -> Result<(), VarError> {
|
|
println!("cargo:rustc-link-lib=dylib=amdhip64");
|
|
if cfg!(windows) {
|
|
let env = env::var("CARGO_CFG_TARGET_ENV")?;
|
|
if env == "msvc" {
|
|
let mut path = PathBuf::from(env::var("HIP_PATH")?);
|
|
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-search=native=/opt/rocm/lib/");
|
|
}
|
|
Ok(())
|
|
}
|