aboutsummaryrefslogtreecommitdiffhomepage
path: root/level_zero-sys/build.rs
diff options
context:
space:
mode:
Diffstat (limited to 'level_zero-sys/build.rs')
-rw-r--r--level_zero-sys/build.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/level_zero-sys/build.rs b/level_zero-sys/build.rs
index 4a638ec..0d2488c 100644
--- a/level_zero-sys/build.rs
+++ b/level_zero-sys/build.rs
@@ -1,18 +1,17 @@
use env::VarError;
use std::{env, path::PathBuf};
-fn main() -> Result<(), VarError> {
+fn main() -> Result<(), VarError> {
println!("cargo:rustc-link-lib=dylib=ze_loader");
- if env::var("CARGO_CFG_WINDOWS").is_ok() {
+ if cfg!(windows) {
let env = env::var("CARGO_CFG_TARGET_ENV")?;
- if env == "gnu" {
- println!("cargo:rustc-link-search=native=C:\\Windows\\System32");
- } else {
+ if env == "msvc" {
let mut path = PathBuf::from(env::var("CARGO_MANIFEST_DIR")?);
- path.push("src");
+ path.push("lib");
println!("cargo:rustc-link-search=native={}", path.display());
+ } else {
+ println!("cargo:rustc-link-search=native=C:\\Windows\\System32");
};
}
- println!("cargo:rerun-if-changed=build.rs");
Ok(())
}