Skip to content

Commit 49950ea

Browse files
committed
build: set target to mingw if TARGET contains windows
To support cross compiling to Windows on non-windows systems.
1 parent 4197972 commit 49950ea

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

build.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ fn main() {
44
let host = env::var_os("HOST")
55
.map(|host| host.into_string().unwrap())
66
.unwrap();
7+
let target = env::var_os("TARGET")
8+
.map(|host| host.into_string().unwrap())
9+
.unwrap();
710

811
let out_dir = env::var_os("OUT_DIR").map(PathBuf::from).unwrap();
912
let build_dir = out_dir.join("lua");
@@ -25,7 +28,7 @@ fn main() {
2528
fs_extra::dir::copy(&src_dir, &build_dir, &opts).unwrap();
2629

2730
let mut command = Command::new("make");
28-
if host.contains("windows") {
31+
if host.contains("windows") || target.contains("windows") {
2932
command.arg("mingw");
3033
}
3134

0 commit comments

Comments
 (0)