aboutsummaryrefslogtreecommitdiffhomepage
path: root/level_zero-sys/build.rs
blob: 4a638eca021d196caf08edd87d474c06d1bf5e7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use env::VarError;
use std::{env, path::PathBuf};

fn main() -> Result<(), VarError> {
    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());
        };
    }
    println!("cargo:rerun-if-changed=build.rs");
    Ok(())
}