diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d66cac8..18a21294 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -116,6 +116,7 @@ jobs: - release arch: - x64 + - arm64 steps: - name: Check out files uses: actions/checkout@v3.5.3 @@ -124,8 +125,11 @@ jobs: fetch-depth: 0 lfs: false - - name: Add mold to PATH - uses: rui314/setup-mold@staging + - name: Install dependencies (arm64) + if: matrix.arch == 'arm64' + run: | + sudo apt-get update + sudo apt-get install crossbuild-essential-arm64 -y - name: Add premake5 to PATH uses: abel0b/setup-premake@v2.2 diff --git a/premake5.lua b/premake5.lua index 9343ca6b..2bde04d6 100644 --- a/premake5.lua +++ b/premake5.lua @@ -120,22 +120,29 @@ workspace "gsc-tool" staticruntime "On" warnings "Extra" - if os.istarget("linux") or os.istarget("darwin") then + filter { "system:linux", "system:macosx" } buildoptions "-pthread" linkoptions "-pthread" + filter {} + + if os.istarget("linux") then + filter { "platforms:arm64" } + buildoptions "--target=arm64-linux-gnu" + linkoptions "--target=arm64-linux-gnu" + filter {} + + linkoptions "-fuse-ld=lld" end - if os.istarget("darwin") then - filter "platforms:arm64" + filter { "system:macosx", "platforms:arm64" } buildoptions "-arch arm64" linkoptions "-arch arm64" - filter {} - end + filter {} filter "configurations:release" optimize "Full" defines "NDEBUG" - flags { "FatalCompileWarnings" } + flags "FatalCompileWarnings" filter {} filter "configurations:debug"