GHA CI: Add support for Windows arm64 (#7758)

This commit is contained in:
namoen0301
2025-12-31 14:25:27 +08:00
committed by GitHub
parent be80b149b1
commit 398fe70b02
7 changed files with 24 additions and 19 deletions

View File

@@ -19,7 +19,7 @@ runs:
choco install `
jom `
nasm `
nodejs
wixtoolset
& "C:\Program Files\OpenSSL\unins000.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- | Out-Host
(Join-Path $Env:ProgramFiles NASM) | Out-File $Env:GITHUB_PATH -Append
(Join-Path (Get-Item -Path "${Env:ProgramFiles(x86)}\WiX Toolset v3.*")[0].FullName bin) | Out-File $Env:GITHUB_PATH -Append

View File

@@ -504,12 +504,18 @@ jobs:
windows:
needs: [ what-to-make ]
runs-on: windows-2022
if: ${{ needs.what-to-make.outputs.make-cli == 'true' || needs.what-to-make.outputs.make-daemon == 'true' || needs.what-to-make.outputs.make-dist == 'true' || needs.what-to-make.outputs.make-qt == 'true' || needs.what-to-make.outputs.make-tests == 'true' || needs.what-to-make.outputs.make-utils == 'true' }}
strategy:
fail-fast: false
matrix:
arch: [x64, x86]
include:
- arch: x86
runner: windows-2022
- arch: x64
runner: windows-2022
- arch: arm64
runner: windows-11-arm
runs-on: ${{ matrix.runner }}
steps:
- name: Show Configuration
run: |

View File

@@ -1,9 +1,14 @@
include(UtilityFunctions.cmake)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64|ARM64)$")
set(ARCH arm64)
set(TR_OPENSSL_ARCH "-arm64")
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(ARCH x64)
set(TR_OPENSSL_ARCH "-x64")
else()
set(ARCH x86)
set(TR_OPENSSL_ARCH "")
endif()
set(VERSION "${TR_USER_AGENT_PREFIX}")
@@ -43,11 +48,6 @@ if(NOT TR_QT_DIR)
set(TR_QT_DIR "$<TARGET_FILE_DIR:Qt${Qt_VERSION_MAJOR}::Core>/..")
endif()
set(TR_OPENSSL_ARCH)
if(ARCH STREQUAL "x64")
set(TR_OPENSSL_ARCH "-x64")
endif()
if(OPENSSL_VERSION MATCHES "^3[.]")
set(TR_OPENSSL_CRYPTO_NAME "libcrypto-3${TR_OPENSSL_ARCH}.dll")
set(TR_OPENSSL_SSL_NAME "libssl-3${TR_OPENSSL_ARCH}.dll")

View File

@@ -3,8 +3,8 @@
<?include TransmissionConfig.wxi ?>
<?if $(sys.BUILDARCH) = x64 ?>
<?define ProductName = "Transmission $(var.TrVersionFull) (x64)" ?>
<?if $(sys.BUILDARCH) != x86 ?>
<?define ProductName = "Transmission $(var.TrVersionFull) ($(sys.BUILDARCH))" ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?define PlatformSystemFolder = "System64Folder" ?>
<?else ?>

View File

@@ -11,7 +11,12 @@ function global:Build-OpenSsl([string] $PrefixDir, [string] $Arch, [string] $Dep
$SourceDir = Invoke-DownloadAndUnpack $Url $Filename
$BuildDir = $SourceDir
$ConfigName = if ($Arch -eq 'x86') { 'VC-WIN32' } else { 'VC-WIN64A' }
$ConfigName = switch ($Arch) {
'x86' { 'VC-WIN32' }
'x64' { 'VC-WIN64A' }
'arm64' { 'VC-WIN64-ARM' }
}
$ConfigOptions = @(
"--prefix=${PrefixDir}"
'--api=1.1.0'

View File

@@ -31,7 +31,6 @@ function global:Build-Qt6([string] $PrefixDir, [string] $Arch, [string] $DepsPre
$BuildDir = Join-Path $SourceDir .build
$ConfigOptions = @(
'-platform'; 'win32-msvc'
'-opensource'
'-confirm-license'
'-prefix'; $PrefixDir
@@ -112,11 +111,6 @@ function global:Build-Qt6([string] $PrefixDir, [string] $Arch, [string] $DepsPre
"-DCMAKE_PREFIX_PATH=${DepsPrefixDir}"
)
if ($env:LDFLAGS) {
# Patch to add our linker flags, mainly /PDBALTPATH
Edit-TextFile (Join-Path $SourceDir qtbase mkspecs win32-msvc qmake.conf) '(^QMAKE_CXXFLAGS\b.*)' "`$1`nQMAKE_LFLAGS += ${env:LDFLAGS}"
}
# No need in GUI and some other tools
Edit-TextFile (Join-Path $SourceDir qttools src CMakeLists.txt) 'TARGET Qt::Widgets' 'QT_FEATURE_designer'
Edit-TextFile (Join-Path $SourceDir qttools src CMakeLists.txt) 'add_subdirectory[(]qdoc[)]' ''

View File

@@ -6,7 +6,7 @@ Param(
[string] $Mode,
[Parameter(Mandatory=$true)]
[ValidateSet('x86', 'x64')]
[ValidateSet('x86', 'x64', 'arm64')]
[string] $BuildArch,
[Parameter()]