@@ -5,6 +5,7 @@ platform=x64
5
5
vs=vs2022
6
6
configuration=Release
7
7
build_only=false
8
+ disable_tests=true
8
9
ci=false
9
10
target_framework=
10
11
verbosity=minimal
@@ -18,10 +19,6 @@ oshost=""
18
19
os=" "
19
20
test=
20
21
21
- if [[ $( uname -m) != * " 64" * ]]; then
22
- platform=x86
23
- fi
24
-
25
22
build ()
26
23
{
27
24
if [ $ci = true ]; then
@@ -67,10 +64,10 @@ generate()
67
64
fi
68
65
69
66
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 " $@ "
71
68
fi
72
69
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
74
71
}
75
72
76
73
restore ()
@@ -180,6 +177,29 @@ detect_os()
180
177
os=$oshost
181
178
}
182
179
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
+ else
189
+ echo " Unknown architecture: $arch "
190
+ fi
191
+ elif [ " $oshost " = " windows" ]; then
192
+ arch=$( echo $PROCESSOR_ARCHITECTURE )
193
+ if [ " $arch " = " AMD64" ]; then
194
+ platform=" x64"
195
+ elif [ " $arch " = " ARM64" ]; then
196
+ platform=" arm64"
197
+ else
198
+ echo " Unknown architecture: $arch "
199
+ fi
200
+ fi
201
+ }
202
+
183
203
find_msbuild ()
184
204
{
185
205
if [ -x " $( command -v MSBuild.exe) " ]; then
@@ -191,6 +211,7 @@ find_msbuild()
191
211
192
212
cmd=$( tr ' [:upper:]' ' [:lower:]' <<< $1 )
193
213
detect_os
214
+ detect_arch
194
215
download_premake
195
216
196
217
while [[ $# > 0 ]]; do
@@ -227,6 +248,9 @@ while [[ $# > 0 ]]; do
227
248
-build_only)
228
249
build_only=true
229
250
;;
251
+ -disable-tests)
252
+ disable_tests=true
253
+ ;;
230
254
esac
231
255
shift
232
256
done
0 commit comments