ZLUDA/ext/amd_comgr-sys/build.rs
Andrzej Janik adc4673a20
Explicitly fail compilation on ROCm 6.4 (#361)
AMD broke comgr ABI in 6.4. This is a temporary solution.
2025-04-20 17:02:05 +02:00

20 lines
716 B
Rust
Vendored

use std::env::VarError;
use std::{env, path::PathBuf};
fn main() -> Result<(), VarError> {
if cfg!(windows) {
println!("cargo:rustc-link-lib=dylib=amd_comgr_2");
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=libamd_comgr.so.2");
println!("cargo:rustc-link-search=native=/opt/rocm/lib/");
}
Ok(())
}