Skip to content

Commit 1c969da

Browse files
authored
update build script to fix cross compilation of windows dlls from unix (#397)
1 parent 45fd2fa commit 1c969da

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mlua-sys/build/main_inner.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use std::env;
2+
13
cfg_if::cfg_if! {
24
if #[cfg(any(feature = "luau", feature = "vendored"))] {
35
#[path = "find_vendored.rs"]
@@ -17,8 +19,8 @@ fn main() {
1719

1820
println!("cargo:rerun-if-changed=build");
1921

20-
#[cfg(windows)]
21-
if cfg!(feature = "module") {
22+
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();
23+
if target_os == "windows" && cfg!(feature = "module") {
2224
if !std::env::var("LUA_LIB_NAME").unwrap_or_default().is_empty() {
2325
// Don't use raw-dylib linking
2426
find::probe_lua();

0 commit comments

Comments
 (0)