ci: Add Windows ARM64 build (#3770)

Add Windows ARM64 build.
- Simplify vcpkg installation with `--triplet=<triplet>`.
- Remove useless `if` in the job `Compute git short SHA`.
- Rename macOS/Windows x86_64 artifacts.
- Disable Discord Rich Presence on Windows ARM64.
- Add flags to disable inclusion of timestamps in PCH files with clang-cl.
- Enable Visual Studio for ARM64 in CMake presets.
- Fix the Windows update script still using '0.2.0' when parsing version.
- external: Update ffmpeg-core
This commit is contained in:
双子叶植物
2026-01-16 23:23:24 +08:00
committed by GitHub
parent 459929cbf3
commit 967e5076ef
6 changed files with 83 additions and 46 deletions
+28 -10
View File
@@ -43,13 +43,25 @@ jobs:
cmake_preset: linux-ninja-clang-appimage
- os: windows-latest
arch: x86_64
cache_path: |
C:\vcpkg\installed
C:\vcpkg\packages
C:\Users\runneradmin\AppData\Local\ccache
C:\vcpkg\installed
C:\vcpkg\packages
C:\Users\runneradmin\AppData\Local\ccache
vcpkg_triplet: x64-windows-static-md
extra_cmake_args: -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static-md
cmake_preset: windows-ninja
- os: windows-11-arm
arch: arm64
cache_path: |
C:\vcpkg\installed
C:\vcpkg\packages
C:\Users\runneradmin\AppData\Local\ccache
vcpkg_triplet: arm64-windows-static-md
extra_cmake_args: -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=arm64-windows-static-md
cmake_preset: windows-ninja-clang
- os: macos-intel
runs_on: macos-latest
cache_path: ~/Library/Caches/ccache
@@ -64,6 +76,7 @@ jobs:
- os: android
runs_on: ubuntu-latest
vcpkg_triplet: arm64-android
steps:
- uses: actions/checkout@v6
@@ -94,17 +107,19 @@ jobs:
- name: Set up build environment (Windows)
run: |
vcpkg install zlib:x64-windows-static-md boost-system:x64-windows-static-md boost-filesystem:x64-windows-static-md boost-program-options:x64-windows-static-md boost-icl:x64-windows-static-md boost-variant:x64-windows-static-md curl:x64-windows-static-md openssl:x64-windows-static-md
vcpkg install zlib boost-system boost-filesystem boost-program-options boost-icl boost-variant curl openssl --triplet=${{ matrix.vcpkg_triplet }}
choco install ccache
if: matrix.os == 'windows-latest'
if: startsWith(matrix.os, 'windows')
- uses: ilammy/msvc-dev-cmd@v1
if: matrix.os == 'windows-latest'
with:
arch: ${{ matrix.arch }}
if: startsWith(matrix.os, 'windows')
- name: Set up build environment (Android)
run: |
sudo apt-get install -y ninja-build
vcpkg install boost-system:arm64-android boost-filesystem:arm64-android boost-program-options:arm64-android boost-icl:arm64-android boost-variant:arm64-android openssl:arm64-android zlib:arm64-android
vcpkg install boost-system boost-filesystem boost-program-options boost-icl boost-variant openssl zlib --triplet=${{ matrix.vcpkg_triplet }}
if: matrix.os == 'android'
- uses: hendrikmuhs/ccache-action@v1.2
@@ -185,7 +200,6 @@ jobs:
- name: Compute git short SHA
shell: bash
if: env.GIT_SHORT_SHA == ''
run: echo "GIT_SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Create DMG (macOS)
@@ -281,7 +295,7 @@ jobs:
elif [[ $dir == *-macos-intel ]]; then
echo "Processing $dir (macOS Intel)"
cp $dir/*.dmg artifacts-master/macos-latest.dmg
cp $dir/*.dmg artifacts-store/vita3k-${{ env.BUILD_VARIABLE }}-${{ env.GIT_SHORT_SHA }}-macos.dmg
cp $dir/*.dmg artifacts-store/vita3k-${{ env.BUILD_VARIABLE }}-${{ env.GIT_SHORT_SHA }}-macos-intel.dmg
elif [[ $dir == *-macos-arm64 ]]; then
echo "Processing $dir (macOS ARM64)"
cp $dir/*.dmg artifacts-master/macos-arm64-latest.dmg
@@ -305,7 +319,11 @@ jobs:
elif [[ $dir == *-windows-latest ]]; then
echo "Processing $dir (Windows x86_64)"
(cd $dir && zip -r ../artifacts-master/windows-latest.zip *)
7z a -mx=9 artifacts-store/vita3k-${{ env.BUILD_VARIABLE }}-${{ env.GIT_SHORT_SHA }}-windows.7z $dir
7z a -mx=9 artifacts-store/vita3k-${{ env.BUILD_VARIABLE }}-${{ env.GIT_SHORT_SHA }}-windows-x86_64.7z $dir
elif [[ $dir == *-windows-11-arm ]]; then
echo "Processing $dir (Windows ARM64)"
(cd $dir && zip -r ../artifacts-master/windows-arm64-latest.zip *)
7z a -mx=9 artifacts-store/vita3k-${{ env.BUILD_VARIABLE }}-${{ env.GIT_SHORT_SHA }}-windows-arm64.7z $dir
fi
done
echo "=== artifacts-master ==="
+10 -2
View File
@@ -45,7 +45,9 @@ if(ANDROID)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
endif()
else()
option(USE_DISCORD_RICH_PRESENCE "Build Vita3K with Discord Rich Presence" ON)
if((ARCHITECTURE STREQUAL "x86_64") OR APPLE)
option(USE_DISCORD_RICH_PRESENCE "Build Vita3K with Discord Rich Presence" ON)
endif()
option(BUILD_APPIMAGE "Build an AppImage." OFF)
endif()
@@ -90,7 +92,7 @@ if (NOT (USE_LTO STREQUAL "NEVER"))
endif()
if( ipo_supported )
if (USE_LTO STREQUAL "ALWAYS")
if (USE_LTO STREQUAL "ALWAYS")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
elseif (USE_LTO STREQUAL "RELEASE_ONLY")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)
@@ -265,6 +267,12 @@ get_boost()
if(WIN32)
add_compile_definitions("_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS" "_CRT_SECURE_NO_WARNINGS" "NOMINMAX")
# Disable inclusion of timestamps in PCH files on Windows
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
string(APPEND CMAKE_C_FLAGS " -Xclang -fno-pch-timestamp")
string(APPEND CMAKE_CXX_FLAGS " -Xclang -fno-pch-timestamp")
endif()
endif()
# Allow per-translation-unit parallel builds when using MSVC
+3 -8
View File
@@ -11,9 +11,6 @@
"hidden": true,
"description": "Base hidden preset to set general options",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"USE_DISCORD_RICH_PRESENCE": true
},
"environment": {
"CMAKE_POLICY_VERSION_MINIMUM": "3.5"
}
@@ -34,16 +31,14 @@
"inherits": "windows",
"displayName": "Windows with Visual Studio 2026",
"description": "Windows native build using Visual Studio 2026 generator and default toolchain/compiler",
"generator": "Visual Studio 18 2026",
"architecture": "x64"
"generator": "Visual Studio 18 2026"
},
{
"name": "windows-vs2022",
"inherits": "windows",
"displayName": "Windows with Visual Studio 2022",
"description": "Windows native build using Visual Studio 2022 generator and default toolchain/compiler",
"generator": "Visual Studio 17 2022",
"architecture": "x64"
"generator": "Visual Studio 17 2022"
},
{
"name": "windows-vs2022-clang",
@@ -150,7 +145,7 @@
}
],
"buildPresets": [
{
{
"name": "windows-vs2026-debug",
"displayName": "Debug",
"description": "Build with debugging information and no compiler optimizations",
+4
View File
@@ -202,7 +202,11 @@ static void download_update(const fs::path &base_path) {
std::thread download([base_path]() {
std::string download_continuous_link = "https://github.com/Vita3K/Vita3K/releases/download/continuous/";
#ifdef _WIN32
#if defined(__aarch64__) || defined(_M_ARM64)
download_continuous_link += "windows-arm64-latest.zip";
#else
download_continuous_link += "windows-latest.zip";
#endif
#elif defined(__APPLE__)
#ifdef __aarch64__
download_continuous_link += "macos-arm64-latest.zip";
+37 -25
View File
@@ -9,38 +9,50 @@ echo ============================================================
for /f "delims=" %%g in ('powershell "((Invoke-RestMethod https://api.github.com/repos/Vita3K/Vita3K/releases/latest -timeout 2).body.Split("\"`n"\") | Select-String -Pattern 'Vita3K Build:') -replace 'Vita3K Build: '"') do @set git_version=%%g
if exist Vita3K.exe (
for /f "delims=" %%v in ('powershell "((Get-Item Vita3K.exe).VersionInfo.FileVersion) -replace '0.2.0.'"') do @set version=%%v
for /f "delims=" %%v in ('powershell "(((Get-Item Vita3K.exe).VersionInfo.FileVersion) -split '\.')[3]"') do @set version=%%v
)
set boot=0
if not exist vita3k-latest.zip (
echo Checking for Vita3K updates...
if "%version%" EQU "%git_version%" (
echo Your current version of Vita3K %version% is up-to-date, enjoy!
pause
exit
) else (
if exist Vita3K.exe (
if "%version%" NEQ "" (
echo Your current version of Vita3K %version% is outdated!
) else (
echo Your current version of Vita3K is unknown.
)
echo Checking for Vita3K updates...
if "%version%" EQU "%git_version%" (
echo Your current version of Vita3K %version% is up-to-date, enjoy!
pause
exit
)
if exist Vita3K.exe (
if "%version%" NEQ "" (
echo Your current version of Vita3K %version% is outdated!
) else (
Setlocal EnableDelayedExpansion
echo Vita3K is not installed, do you want to install it?
choice /c YN /n /m "Press Y for Yes, N for No."
if !errorlevel! EQU 2 (
echo Installation canceled.
pause
exit
)
echo Your current version of Vita3K is unknown.
)
echo Attempting to download and extract the latest Vita3K version %git_version% in progress...
powershell "Invoke-WebRequest https://github.com/Vita3K/Vita3K/releases/download/continuous/windows-latest.zip -OutFile vita3k-latest.zip"
if exist Vita3K.exe (
taskkill /F /IM Vita3K.exe
) else (
setlocal enableDelayedExpansion
echo Vita3K is not installed, do you want to install it?
choice /c YN /n /m "Press Y for Yes, N for No."
if !errorlevel! EQU 2 (
echo Installation canceled.
pause
exit
)
endlocal
)
setlocal enableDelayedExpansion
set arch=%PROCESSOR_ARCHITECTURE%
if "!arch!" == "AMD64" (
set zip_name=windows-latest.zip
) else if "!arch!" == "ARM64" (
set zip_name=windows-arm64-latest.zip
) else (
echo Unsupported architecture: !arch!
pause
exit
)
echo Attempting to download and extract the latest Vita3K version %git_version% in progress...
powershell "Invoke-WebRequest https://github.com/Vita3K/Vita3K/releases/download/continuous/!zip_name! -OutFile vita3k-latest.zip"
endlocal
if exist Vita3K.exe (
taskkill /F /IM Vita3K.exe
)
) else (
set boot=1