Skip to content

Commit

Permalink
Fix cross-compilation to Windows on non-Windows
Browse files Browse the repository at this point in the history
Fixes #86
  • Loading branch information
taiki-e committed Oct 19, 2024
1 parent fee01d0 commit e4bd989
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,15 @@ if [[ "${build_tool}" == "cargo-zigbuild" ]]; then
zigbuild_target="${target}"
target="${target%%.*}"
fi
case "${target}" in
wasm*) exe=.wasm ;;
*-windows*) exe=.exe ;;
*) exe='' ;;
esac
target_lower="${target//-/_}"
target_lower="${target_lower//./_}"
target_upper=$(tr '[:lower:]' '[:upper:]' <<<"${target_lower}")

exe=''
case "$(uname -s)" in
Linux)
platform=unix
Expand All @@ -189,7 +193,6 @@ case "$(uname -s)" in
MINGW* | MSYS* | CYGWIN* | Windows_NT)
platform=windows
host_os=windows
exe=.exe
;;
*) bail "unrecognized OS type '$(uname -s)'" ;;
esac
Expand Down

0 comments on commit e4bd989

Please sign in to comment.