Allow linking to system ntdll (#4)

* Allow linking to system ntdll

* Use imported `var`
This commit is contained in:
Mateusz Mikuła
2020-08-13 22:44:56 +02:00
committed by GitHub
parent 9856cbbae2
commit ae55cad0b0
+8 -2
View File
@@ -1,9 +1,15 @@
use std::env::var;
fn main() {
#[cfg(feature = "user")] {
if std::env::var("TARGET").map(
if var("TARGET").map(
|t| t == "x86_64-pc-windows-gnu" || t == "i686-pc-windows-gnu"
).unwrap_or(false) {
println!("cargo:rustc-link-lib=winapi_ntdll");
if var("WINAPI_NO_BUNDLED_LIBRARIES").is_ok() {
println!("cargo:rustc-link-lib=ntdll");
} else {
println!("cargo:rustc-link-lib=winapi_ntdll");
}
}
}
}