2020-08-28 22:37:16 +02:00
|
|
|
use env::VarError;
|
|
|
|
use std::{env, path::PathBuf};
|
2020-02-16 15:58:15 +01:00
|
|
|
|
2021-01-08 17:17:46 +01:00
|
|
|
fn main() -> Result<(), VarError> {
|
2020-02-16 15:58:15 +01:00
|
|
|
println!("cargo:rustc-link-lib=dylib=ze_loader");
|
2021-01-08 17:17:46 +01:00
|
|
|
if cfg!(windows) {
|
2020-08-28 22:37:16 +02:00
|
|
|
let env = env::var("CARGO_CFG_TARGET_ENV")?;
|
2021-01-08 17:17:46 +01:00
|
|
|
if env == "msvc" {
|
2020-08-28 22:37:16 +02:00
|
|
|
let mut path = PathBuf::from(env::var("CARGO_MANIFEST_DIR")?);
|
2021-01-08 17:17:46 +01:00
|
|
|
path.push("lib");
|
2020-08-28 22:37:16 +02:00
|
|
|
println!("cargo:rustc-link-search=native={}", path.display());
|
2021-01-08 17:17:46 +01:00
|
|
|
} else {
|
|
|
|
println!("cargo:rustc-link-search=native=C:\\Windows\\System32");
|
2020-08-28 22:37:16 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
Ok(())
|
|
|
|
}
|