Skip to content

Commit e4bd989

Browse files
committed
Fix cross-compilation to Windows on non-Windows
Fixes #86
1 parent fee01d0 commit e4bd989

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

main.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,15 @@ if [[ "${build_tool}" == "cargo-zigbuild" ]]; then
163163
zigbuild_target="${target}"
164164
target="${target%%.*}"
165165
fi
166+
case "${target}" in
167+
wasm*) exe=.wasm ;;
168+
*-windows*) exe=.exe ;;
169+
*) exe='' ;;
170+
esac
166171
target_lower="${target//-/_}"
167172
target_lower="${target_lower//./_}"
168173
target_upper=$(tr '[:lower:]' '[:upper:]' <<<"${target_lower}")
169174

170-
exe=''
171175
case "$(uname -s)" in
172176
Linux)
173177
platform=unix
@@ -189,7 +193,6 @@ case "$(uname -s)" in
189193
MINGW* | MSYS* | CYGWIN* | Windows_NT)
190194
platform=windows
191195
host_os=windows
192-
exe=.exe
193196
;;
194197
*) bail "unrecognized OS type '$(uname -s)'" ;;
195198
esac

0 commit comments

Comments
 (0)