From 81704a19db49e6bad0d7637212a5b1c37cfa0a45 Mon Sep 17 00:00:00 2001 From: Edo Date: Fri, 23 Jun 2023 22:39:53 +0200 Subject: [PATCH] build: add arm64 (#19) --- .github/workflows/build.yml | 28 ++++++++++++++++++++++++++++ premake5.lua | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 113f0ef..2262e6d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,6 +73,7 @@ jobs: - Release arch: - x64 + - arm64 include: - configuration: Debug config: debug @@ -93,6 +94,23 @@ jobs: sudo apt-get update sudo apt-get -y install libcurl4-gnutls-dev + - name: Install cross build tools (arm64) + if: matrix.arch == 'arm64' + run: | + sudo apt-get update + sudo apt-get -y install crossbuild-essential-arm64 + + - name: Install dependencies (arm64) + if: matrix.arch == 'arm64' + run: | + echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy main multiverse universe" | sudo tee /etc/apt/sources.list + echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-security main multiverse universe" | sudo tee -a /etc/apt/sources.list + echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-backports main multiverse universe" | sudo tee -a /etc/apt/sources.list + echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy-updates main multiverse universe" | sudo tee -a /etc/apt/sources.list + sudo dpkg --add-architecture arm64 + sudo apt-get update + sudo apt-get -y install libcurl4-gnutls-dev:arm64 + - name: Install Mold uses: rui314/setup-mold@staging @@ -107,6 +125,16 @@ jobs: - name: Set up problem matching uses: ammaraskar/gcc-problem-matcher@master + - name: Set up CC environment variable + if: matrix.arch == 'arm64' + run: | + echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV + + - name: Set up CXX environment variable + if: matrix.arch == 'arm64' + run: | + echo "CXX=aarch64-linux-gnu-g++" >> $GITHUB_ENV + - name: Build ${{matrix.configuration}} ${{matrix.arch}} binaries run: | pushd build diff --git a/premake5.lua b/premake5.lua index 4b66bb9..aa3f658 100644 --- a/premake5.lua +++ b/premake5.lua @@ -41,7 +41,7 @@ configurations {"Debug", "Release"} if os.istarget("darwin") then platforms {"x64"} else - platforms {"x86", "x64"} + platforms {"x86", "x64", "arm64"} end filter "platforms:x86"