@@ -5,6 +5,7 @@ platform=x64
55vs=vs2022
66configuration=Release
77build_only=false
8+ disable_tests=true
89ci=false
910target_framework=
1011verbosity=minimal
@@ -18,10 +19,6 @@ oshost=""
1819os=" "
1920test=
2021
21- if [[ $( uname -m) != * " 64" * ]]; then
22- platform=x86
23- fi
24-
2522build ()
2623{
2724 if [ $ci = true ]; then
@@ -67,10 +64,10 @@ generate()
6764 fi
6865
6966 if [ " $os " = " linux" ] || [ " $os " = " macosx" ]; then
70- " $builddir /premake.sh" --file=" $builddir /premake5.lua" gmake2 --os=$os --arch=$platform --configuration=$configuration --target-framework=$target_framework " $@ "
67+ " $builddir /premake.sh" --file=" $builddir /premake5.lua" gmake2 --os=$os --arch=$platform --configuration=$configuration --target-framework=$target_framework --disable-tests= $disable_tests " $@ "
7168 fi
7269
73- " $builddir /premake.sh" --file=" $builddir /premake5.lua" $vs --os=$os --arch=$platform --configuration=$configuration --target-framework=$target_framework
70+ " $builddir /premake.sh" --file=" $builddir /premake5.lua" $vs --os=$os --arch=$platform --configuration=$configuration --target-framework=$target_framework --disable-tests= $disable_tests
7471}
7572
7673restore ()
@@ -180,6 +177,33 @@ detect_os()
180177 os=$oshost
181178}
182179
180+ detect_arch ()
181+ {
182+ if [ " $oshost " = " linux" ] || [ " $oshost " = " macosx" ]; then
183+ arch=$( uname -m)
184+ if [ " $arch " = " x86_64" ]; then
185+ platform=" x64"
186+ elif [ " $arch " = " arm64" ] || [ " $arch " = " aarch64" ]; then
187+ platform=" arm64"
188+ elif [ " $arch " = " i686" ] || [ " $arch " = " i386" ]; then
189+ platform=" x86"
190+ else
191+ echo " Unknown architecture: $arch "
192+ fi
193+ elif [ " $oshost " = " windows" ]; then
194+ arch=$( echo $PROCESSOR_ARCHITECTURE )
195+ if [ " $arch " = " AMD64" ]; then
196+ platform=" x64"
197+ elif [ " $arch " = " ARM64" ]; then
198+ platform=" arm64"
199+ elif [ " $arch " = " x86" ]; then
200+ platform=" x86"
201+ else
202+ echo " Unknown architecture: $arch "
203+ fi
204+ fi
205+ }
206+
183207find_msbuild ()
184208{
185209 if [ -x " $( command -v MSBuild.exe) " ]; then
@@ -191,6 +215,7 @@ find_msbuild()
191215
192216cmd=$( tr ' [:upper:]' ' [:lower:]' <<< $1 )
193217detect_os
218+ detect_arch
194219download_premake
195220
196221while [[ $# > 0 ]]; do
@@ -227,6 +252,9 @@ while [[ $# > 0 ]]; do
227252 -build_only)
228253 build_only=true
229254 ;;
255+ -disable-tests)
256+ disable_tests=true
257+ ;;
230258 esac
231259 shift
232260done
0 commit comments