Skip to content

Commit 60365f4

Browse files
chroxkornelski
authored andcommitted
Fix cross-compilation for Windows on Linux
1 parent 7f920bc commit 60365f4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

build.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,13 @@ fn build(target_os: &str) -> io::Result<()> {
229229
"--arch={}",
230230
env::var("CARGO_CFG_TARGET_ARCH").unwrap()
231231
));
232-
configure.arg(format!("--target_os={}", target_os));
232+
if target_os == "windows" {
233+
// fix `configure: Unknown OS 'windows'`
234+
configure.arg(format!("--target_os={}", "mingw32"));
235+
} else {
236+
configure.arg(format!("--target_os={}", target_os));
237+
}
238+
233239
}
234240

235241
// control debug build

0 commit comments

Comments
 (0)