CI: Add ARM64 Windows and Linux builds (#1778)

* ci: Try arm64 Linux/Windows builds

* Update aurora

* Explicitly set CMAKE_SYSTEM_PROCESSOR on Windows

* Update build-appimage.sh for aarch64

* Set Rust_RUSTUP_INSTALL_MISSING_TARGET=ON

* Use CMAKE_SYSTEM_PROCESSOR normalization for jpeg-turbo build too

* MSVC ARM64 support for freeverb
This commit is contained in:
Luke Street
2026-05-23 19:32:50 -06:00
committed by GitHub
parent db7e2a1e7b
commit ce0185adc4
7 changed files with 50 additions and 17 deletions
+12 -12
View File
@@ -22,13 +22,13 @@ jobs:
matrix:
include:
- name: GCC x86_64
runner: ubuntu-latest
runner: ubuntu-24.04
preset: gcc
artifact_arch: x86_64
# - name: GCC aarch64
# runner: ubuntu-24.04-arm
# preset: gcc
# artifact_arch: aarch64
- name: GCC aarch64
runner: ubuntu-24.04-arm
preset: gcc
artifact_arch: aarch64
# - name: Clang x86_64
# runner: ubuntu-latest
# preset: clang
@@ -221,12 +221,12 @@ jobs:
msvc_arch: amd64
vcpkg_arch: x64
artifact_arch: x86_64
# - name: MSVC arm64
# runner: windows-11-arm
# preset: arm64-msvc
# msvc_arch: arm64
# vcpkg_arch: arm64
# artifact_arch: arm64
- name: MSVC arm64
runner: windows-latest
preset: arm64-msvc
msvc_arch: amd64_arm64
vcpkg_arch: arm64
artifact_arch: arm64
# - name: Clang x86_64
# runner: windows-latest
# preset: clang
@@ -255,7 +255,7 @@ jobs:
- name: Install dependencies
run: |
choco install ninja
vcpkg install freetype:${{matrix.vcpkg_arch}}-windows-static zstd:${{matrix.vcpkg_arch}}-windows-static
vcpkg install freetype:${{matrix.vcpkg_arch}}-windows zstd:${{matrix.vcpkg_arch}}-windows
- name: Configure CMake
run: cmake --preset x-windows-ci-${{matrix.preset}}
+3
View File
@@ -100,6 +100,8 @@ project(dusklight LANGUAGES C CXX VERSION ${DUSK_VERSION_STRING})
if (APPLE)
enable_language(OBJC OBJCXX)
endif ()
# Adjust CMAKE_SYSTEM_PROCESSOR on Windows to match compiler target
include(cmake/WindowsTargetProcessor.cmake)
if (APPLE AND NOT TVOS AND CMAKE_SYSTEM_NAME STREQUAL tvOS)
# ios.toolchain.cmake hack for SDL
set(TVOS ON)
@@ -168,6 +170,7 @@ if (DUSK_MOVIE_SUPPORT)
endif ()
set(_jpeg_cmake_args
-DCMAKE_INSTALL_PREFIX=${_jpeg_install_dir}
-DCMAKE_PROJECT_INCLUDE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/WindowsTargetProcessor.cmake
-DENABLE_SHARED=OFF
-DWITH_TURBOJPEG=ON
-DWITH_JAVA=OFF
+9 -2
View File
@@ -33,7 +33,11 @@
"value": true
},
"DUSK_SENTRY_DSN": "$env{SENTRY_DSN}",
"DUSK_SENTRY_ENVIRONMENT": "production"
"DUSK_SENTRY_ENVIRONMENT": "production",
"Rust_RUSTUP_INSTALL_MISSING_TARGET": {
"type": "BOOL",
"value": true
}
}
},
{
@@ -489,7 +493,10 @@
"inherits": [
"x-windows-ci",
"windows-arm64-msvc"
]
],
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "arm64-windows"
}
}
],
"buildPresets": [
+2 -1
View File
@@ -6,6 +6,7 @@ fi
build_dir="$PWD/build"
linuxdeploy="$build_dir/linuxdeploy-$(uname -m).AppImage"
lib_dir="/usr/lib/$(uname -m)-linux-gnu"
# Get linuxdeploy
mkdir -p "$build_dir"
@@ -23,4 +24,4 @@ cp platforms/freedesktop/dusklight.desktop build/appdir/usr/share/applications
cd build/install
VERSION="$DUSK_VERSION" NO_STRIP=1 "$linuxdeploy" \
-l /usr/lib/x86_64-linux-gnu/libusb-1.0.so --appdir "$build_dir/appdir" --output appimage
-l "$lib_dir/libusb-1.0.so" --appdir "$build_dir/appdir" --output appimage
+9
View File
@@ -0,0 +1,9 @@
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
if (CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARM64" OR CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARM64EC")
set(CMAKE_SYSTEM_PROCESSOR "ARM64")
elseif (CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "x64")
set(CMAKE_SYSTEM_PROCESSOR "AMD64")
elseif (CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "X86")
set(CMAKE_SYSTEM_PROCESSOR "X86")
endif ()
endif ()
+1 -1
+14 -1
View File
@@ -13,20 +13,33 @@ inline denormal_state denormals_enable()
}
inline void denormals_restore(denormal_state saved) { _mm_setcsr(saved); }
#elif defined(__aarch64__) || defined(_M_ARM64)
#elif defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
#include <cstdint>
#if defined(_MSC_VER) && !defined(__clang__) && (defined(_M_ARM64) || defined(_M_ARM64EC))
#include <intrin.h>
#endif
using denormal_state = uint64_t;
inline denormal_state denormals_enable()
{
#if defined(_MSC_VER) && !defined(__clang__) && (defined(_M_ARM64) || defined(_M_ARM64EC))
denormal_state saved = static_cast<denormal_state>(_ReadStatusReg(ARM64_FPCR));
_WriteStatusReg(ARM64_FPCR, static_cast<__int64>(saved | (1ULL << 24))); // FZ
return saved;
#else
denormal_state saved;
asm volatile("mrs %0, fpcr" : "=r"(saved));
asm volatile("msr fpcr, %0" :: "r"(saved | (1ULL << 24))); // FZ
return saved;
#endif
}
inline void denormals_restore(denormal_state saved)
{
#if defined(_MSC_VER) && !defined(__clang__) && (defined(_M_ARM64) || defined(_M_ARM64EC))
_WriteStatusReg(ARM64_FPCR, static_cast<__int64>(saved));
#else
asm volatile("msr fpcr, %0" :: "r"(saved));
#endif
}
#elif defined(__arm__) || defined(_M_ARM)