From 16afa9398cd5b2a6465960b20db3880c8c731d46 Mon Sep 17 00:00:00 2001 From: Edo Date: Thu, 29 Jun 2023 22:11:49 +0200 Subject: [PATCH] build(linux): arm64 - remove mold linker (#137) --- .github/workflows/build.yml | 8 ++++++-- premake5.lua | 19 +++++++++++++------ 2 files changed, 19 insertions(+), 8 deletions(-) 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"