ZLUDA/zluda/build.rs

21 lines
656 B
Rust
Raw Permalink Normal View History

use env::VarError;
use std::{env, path::PathBuf};
2020-11-11 22:35:34 +01:00
// 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
2020-11-11 22:35:34 +01:00
fn main() -> Result<(), VarError> {
2020-11-11 22:35:34 +01:00
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");
};
2020-11-11 22:35:34 +01:00
}
Ok(())
}