From adecccc1abab99eae5838f59cc2e49624136f9f6 Mon Sep 17 00:00:00 2001 From: w1nst0n Date: Tue, 28 Sep 2021 14:30:18 +0200 Subject: [PATCH] Do not use cfg when cross compiling --- build.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/build.rs b/build.rs index 94dc9f2..9699618 100644 --- a/build.rs +++ b/build.rs @@ -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"); } -} - +} \ No newline at end of file