Do not use cfg when cross compiling

This commit is contained in:
w1nst0n 2021-09-28 14:30:18 +02:00
commit adecccc1ab
No known key found for this signature in database
GPG key ID: 34D27465928A0A1D

View file

@ -1,7 +1,11 @@
use std::env::var;
fn main() {
let target = var("TARGET").unwrap();
println!("cargo:rerun-if-changed=build.rs");
if cfg!(all(windows, not(target_env = "msvc"))) {
if target.contains("windows") && !target.contains("msvc") {
println!("cargo:rerun-if-env-changed=WINAPI_NO_BUNDLED_LIBRARIES");
println!("cargo:rerun-if-env-changed=WINAPI_STATIC_NOBUNDLE");
@ -9,5 +13,4 @@ fn main() {
println!("cargo:rustc-link-lib=static=stdc++");
println!("cargo:rustc-link-lib=static=winpthread");
}
}
}