mirror of
https://github.com/vosen/ZLUDA.git
synced 2025-04-20 08:24:44 +00:00
Fixes issues pointed out in #27: * spirv_tools-sys was build in non-test profiles * By default ZLUDA dll has a wrong name * We relied on third-party OpenCL installation on Windows * We encouraged building debug configuration * We didn't provide build information for developers (cmake, python, submodules)
20 lines
656 B
Rust
20 lines
656 B
Rust
use env::VarError;
|
|
use std::{env, path::PathBuf};
|
|
|
|
// HACK ALERT
|
|
// This is a temporary hack to to make sure that linker does not pick up
|
|
// NVIDIA OpenCL .lib using paths injected by cl-sys
|
|
|
|
fn main() -> Result<(), VarError> {
|
|
if cfg!(windows) {
|
|
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");
|
|
};
|
|
}
|
|
Ok(())
|
|
}
|