diff options
author | Eric Stokes <eestokes@pm.me> | 2024-04-17 15:29:41 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-17 20:29:41 +0100 |
commit | 1c969da2869bcf148587b19d20762f3a1d126cec (patch) | |
tree | 2fe3c4a9ca632c2d444cc927cdff71a79e65d82d | |
parent | 45fd2fa40afd53c4e3ed324035ce1bb72304970b (diff) | |
download | mlua-1c969da2869bcf148587b19d20762f3a1d126cec.zip |
update build script to fix cross compilation of windows dlls from unix (#397)
-rw-r--r-- | mlua-sys/build/main_inner.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mlua-sys/build/main_inner.rs b/mlua-sys/build/main_inner.rs index 668f40b..05ac53b 100644 --- a/mlua-sys/build/main_inner.rs +++ b/mlua-sys/build/main_inner.rs @@ -1,3 +1,5 @@ +use std::env; + cfg_if::cfg_if! { if #[cfg(any(feature = "luau", feature = "vendored"))] { #[path = "find_vendored.rs"] @@ -17,8 +19,8 @@ fn main() { println!("cargo:rerun-if-changed=build"); - #[cfg(windows)] - if cfg!(feature = "module") { + let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap(); + if target_os == "windows" && cfg!(feature = "module") { if !std::env::var("LUA_LIB_NAME").unwrap_or_default().is_empty() { // Don't use raw-dylib linking find::probe_lua(); |