From 46b72141d1b8d8ab0e3e4ec419855808ce18437a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20D=C3=BCrrenberger?= Date: Thu, 28 Aug 2025 13:53:23 +0200 Subject: [PATCH] Add support for Windows ARM64 architecture --- .github/workflows/nuget.yml | 10 +++++++-- .github/workflows/release.yml | 39 +++++++++++++++++++++++++++++++++++ tools/nuget/build.win.ps1 | 6 +++++- 3 files changed, 52 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml index 4a39ddb..7fdd086 100644 --- a/.github/workflows/nuget.yml +++ b/.github/workflows/nuget.yml @@ -37,10 +37,16 @@ jobs: cd CSFML/tools/nuget ./build.win.ps1 "win-x64" + - name: Build ARM64 + shell: pwsh + run: | + cd CSFML/tools/nuget + ./build.win.ps1 "win-arm64" + - name: Upload Artifact uses: actions/upload-artifact@v4 with: - name: CSFML-win-x86-x64 + name: CSFML-win-x86-x64-arm64 path: CSFML/tools/nuget/CSFML/runtimes linux-x64: @@ -213,7 +219,7 @@ jobs: package: name: Package Builds - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 needs: - windows - linux-x64 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d9ba44b..0ba3007 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -191,6 +191,45 @@ jobs: name: CSFML-windows-64-bit path: install/CSFML + windows-arm64: + name: Windows ARM64 + runs-on: windows-2025 + + steps: + - name: Checkout SFML + uses: actions/checkout@v4 + with: + repository: SFML/SFML + ref: ${{ env.SFML_VERSION }} + path: SFML + + - name: Checkout CSFML + uses: actions/checkout@v4 + with: + path: CSFML + + - name: Build SFML + run: | + cmake -S SFML -B SFML-build -A ARM64 -G "Visual Studio 17 2022" -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/SFML-install -DCMAKE_VERBOSE_MAKEFILE=ON + cmake --build SFML-build --config Release --target install + + - name: Build CSFML + run: | + cmake -S CSFML -B CSFML-build -A ARM64 -G "Visual Studio 17 2022" -DBUILD_SHARED_LIBS=ON -DCSFML_LINK_SFML_STATICALLY=OFF -DCMAKE_BUILD_TYPE=Release -DSFML_ROOT=${{ github.workspace }}/SFML-install -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/CSFML-install -DCMAKE_VERBOSE_MAKEFILE=ON + cmake --build CSFML-build --config Release --target install + + - name: Move Files + shell: pwsh + run: | + New-Item -ItemType "directory" -PATH "install\CSFML" + Move-Item -Path "CSFML-install\*" -Destination "install\CSFML" + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: CSFML-windows-arm64 + path: install/CSFML + macos-x64: name: macOS x64 runs-on: macos-13 diff --git a/tools/nuget/build.win.ps1 b/tools/nuget/build.win.ps1 index 7b88f1a..6165e85 100644 --- a/tools/nuget/build.win.ps1 +++ b/tools/nuget/build.win.ps1 @@ -18,6 +18,7 @@ if (-not $RID) { $Generator = 'Visual Studio 17 2022' +# See also: https://learn.microsoft.com/en-us/dotnet/core/rid-catalog#known-rids switch ($RID) { 'win-x86' { $Architecture = 'Win32' @@ -25,6 +26,9 @@ switch ($RID) { 'win-x64' { $Architecture = 'x64' } + 'win-arm64' { + $Architecture = 'ARM64' + } Default { Write-Error "Unknown RID '$RID'" exit @@ -83,7 +87,7 @@ Push-Location "SFML" $SFMLDir = (Get-Item .).FullName -IF ($RID -ne 'win-x86' -and $RID -ne 'win-x64') { +IF ($RID -ne 'win-x86' -and $RID -ne 'win-x64' -and $RID -ne 'win-arm64') { Write-Error "Unknown RID '$RID'" exit }