ZLUDA/level_zero-sys/build.rs

19 lines
621 B
Rust
Raw Normal View History

use env::VarError;
use std::{env, path::PathBuf};
2020-02-16 15:58:15 +01:00
fn main() -> Result<(), VarError> {
2020-02-16 15:58:15 +01:00
println!("cargo:rustc-link-lib=dylib=ze_loader");
if env::var("CARGO_CFG_WINDOWS").is_ok() {
let env = env::var("CARGO_CFG_TARGET_ENV")?;
if env == "gnu" {
println!("cargo:rustc-link-search=native=C:\\Windows\\System32");
} else {
let mut path = PathBuf::from(env::var("CARGO_MANIFEST_DIR")?);
path.push("src");
println!("cargo:rustc-link-search=native={}", path.display());
};
}
2020-02-16 15:58:15 +01:00
println!("cargo:rerun-if-changed=build.rs");
Ok(())
}