11#! /usr/bin/env bash
22set -e
33builddir=$( cd " $( dirname " $0 " ) " ; pwd)
4- platform=x64
54vs=vs2022
65configuration=DebugOpt
76build_only=false
@@ -18,8 +17,17 @@ oshost=""
1817os=" "
1918test=
2019
21- if [[ $( uname -m) != * " 64" * ]]; then
20+ _machine=$( uname -m)
21+
22+ if [[ $_machine == " arm64" ]]; then
23+ platform=" arm64"
24+ elif [[ $_machine == " x86_64" ]]; then
25+ platform=" x64"
26+ elif [[ $_machine == " i686" ]]; then
2227 platform=x86
28+ else
29+ echo " Unsupported machine type: ${_machine} "
30+ exit 1
2331fi
2432
2533build ()
@@ -103,7 +111,7 @@ test()
103111}
104112
105113clean ()
106- {
114+ {
107115 rm -rf " $objdir "
108116 rm -rf " $gendir "
109117 rm -rf " $bindir "
@@ -125,7 +133,7 @@ download_premake()
125133
126134 if ! [ -f " $premake_path " ]; then
127135 echo " Downloading and unpacking Premake..."
128- premake_version=5.0.0-beta2
136+ premake_version=5.0.0-beta8
129137 premake_archive=premake-$premake_version -$oshost .$premake_archive_ext
130138 premake_url=https://github.com/premake/premake-core/releases/download/v$premake_version /$premake_archive
131139 curl -L -O $premake_url
@@ -161,7 +169,9 @@ package_llvm()
161169
162170detect_os ()
163171{
164- case " $( uname -s) " in
172+ local _system=$( uname -s)
173+
174+ case " ${_system} " in
165175 Darwin)
166176 oshost=macosx
167177 ;;
@@ -172,7 +182,7 @@ detect_os()
172182 oshost=windows
173183 ;;
174184 * )
175- echo " Unsupported platform"
185+ echo " Unsupported platform: ${_system} "
176186 exit 1
177187 ;;
178188 esac
@@ -202,7 +212,7 @@ while [[ $# > 0 ]]; do
202212 -configuration)
203213 configuration=$2
204214 shift
205- ;;
215+ ;;
206216 -platform)
207217 platform=$2
208218 shift
@@ -240,7 +250,7 @@ case "$cmd" in
240250 ;;
241251 generate_config)
242252 generate_config
243- ;;
253+ ;;
244254 prepack)
245255 prepack
246256 ;;
0 commit comments