Browse Source

Auto-detect architecture in `build.sh`.

pull/1879/head
Joao Matos 8 months ago
parent
commit
29653a0bd0
  1. 32
      build/build.sh

32
build/build.sh

@ -18,10 +18,6 @@ oshost="" @@ -18,10 +18,6 @@ oshost=""
os=""
test=
if [[ $(uname -m) != *"64"* ]]; then
platform=x86
fi
build()
{
if [ $ci = true ]; then
@ -180,6 +176,33 @@ detect_os() @@ -180,6 +176,33 @@ detect_os()
os=$oshost
}
detect_arch()
{
if [ "$oshost" = "linux" ] || [ "$oshost" = "macosx" ]; then
arch=$(uname -m)
if [ "$arch" = "x86_64" ]; then
platform="x64"
elif [ "$arch" = "arm64" ] || [ "$arch" = "aarch64" ]; then
platform="arm64"
elif [ "$arch" = "i686" ] || [ "$arch" = "i386" ]; then
platform="x86"
else
echo "Unknown architecture: $arch"
fi
elif [ "$oshost" = "windows" ]; then
arch=$(echo $PROCESSOR_ARCHITECTURE)
if [ "$arch" = "AMD64" ]; then
platform="x64"
elif [ "$arch" = "ARM64" ]; then
platform="arm64"
elif [ "$arch" = "x86" ]; then
platform="x86"
else
echo "Unknown architecture: $arch"
fi
fi
}
find_msbuild()
{
if [ -x "$(command -v MSBuild.exe)" ]; then
@ -191,6 +214,7 @@ find_msbuild() @@ -191,6 +214,7 @@ find_msbuild()
cmd=$(tr '[:upper:]' '[:lower:]' <<< $1)
detect_os
detect_arch
download_premake
while [[ $# > 0 ]]; do

Loading…
Cancel
Save