Skip to content

Commit

Permalink
Attempt Windows ARM64 build
Browse files Browse the repository at this point in the history
  • Loading branch information
jdpurcell committed Apr 23, 2023
1 parent 6304310 commit 3e5bb2a
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 39 deletions.
62 changes: 46 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,29 @@ jobs:
strategy:
matrix:
include:
- runner: 'ubuntu-18.04'
qtVersion: '5.15.2'
- runner: 'macOS-11'
qtVersion: '6.2.2'
qtModules: 'qtimageformats'
- runner: 'macOS-10.15'
qtVersion: '5.12.12'
osSuffix: '_legacy'
skipHardPlugins: 'true'
# - runner: 'ubuntu-18.04'
# qtVersion: '5.15.2'
# - runner: 'macOS-11'
# qtVersion: '6.2.2'
# qtModules: 'qtimageformats'
# - runner: 'macOS-10.15'
# qtVersion: '5.12.12'
# osSuffix: '_legacy'
# skipHardPlugins: 'true'
# - runner: 'windows-2019'
# qtVersion: '6.2.2'
# qtArch: 'win64_msvc2019_64'
# osSuffix: '_64'
# qtModules: 'qtimageformats'
- runner: 'windows-2019'
qtVersion: '6.2.2'
qtArch: 'win64_msvc2019_64'
osSuffix: '_64'
qtVersion: '6.4.3'
qtArch: 'win64_msvc2019_arm64'
osSuffix: '_arm64'
qtModules: 'qtimageformats'
- runner: 'windows-2019'
qtVersion: '5.15.2'
qtArch: 'win32_msvc2019'
osSuffix: '_32'
# - runner: 'windows-2019'
# qtVersion: '5.15.2'
# qtArch: 'win32_msvc2019'
# osSuffix: '_32'
runs-on: ${{ matrix.runner }}
steps:
- name: Set environment variables
Expand All @@ -46,6 +51,14 @@ jobs:
- uses: actions/checkout@v3

- name: Install Qt (Host)
if: matrix.qtArch == 'win64_msvc2019_arm64'
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qtVersion }}
arch: 'win64_msvc2019_64'
cache: true

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
Expand All @@ -54,6 +67,23 @@ jobs:
cache: true
modules: ${{ matrix.qtModules }}

- name: Configure Qt Env 1
if: matrix.qtArch == 'win64_msvc2019_arm64'
shell: pwsh
run: |
echo "Qt6_DIR=${{ runner.workspace }}\Qt\${{ matrix.qtVersion }}\msvc2019_arm64" >> $env:GITHUB_ENV
echo "QT_PLUGIN_PATH=${{ runner.workspace }}\Qt\${{ matrix.qtVersion }}\msvc2019_arm64\plugins" >> $env:GITHUB_ENV
echo "QML2_IMPORT_PATH=${{ runner.workspace }}\Qt\${{ matrix.qtVersion }}\msvc2019_arm64\qml" >> $env:GITHUB_ENV
echo "QT_HOST_PATH=${{ runner.workspace }}\Qt\${{ matrix.qtVersion }}\msvc2019_64" >> $env:GITHUB_ENV
- name: Configure Qt Env 2
if: matrix.qtArch == 'win64_msvc2019_arm64'
shell: sh
run: |
sed -i "s,/Users/qt/work/install/,`echo -E ${Qt6_DIR} | tr '\\' '/'`/../msvc2019_64/," "${Qt6_DIR}/bin/qtpaths.bat"
sed -i "s,/Users/qt/work/install/,`echo -E ${Qt6_DIR} | tr '\\' '/'`/../msvc2019_64/," "${Qt6_DIR}/bin/qmake.bat"
${Qt6_DIR}/bin/qmake.bat -query
- name: Build qView
shell: pwsh
run: ci/scripts/build.ps1
Expand Down
15 changes: 10 additions & 5 deletions ci/scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@ if ($IsWindows) {
ci/scripts/vcvars.ps1
}

if ((qmake --version -split '\n')[1][17] -eq '6') {
qmake QMAKE_APPLE_DEVICE_ARCHS="x86_64 arm64" $args[0] PREFIX=$Prefix DEFINES+="$env:nightlyDefines"
} else {
qmake $args[0] PREFIX=$Prefix DEFINES+="$env:nightlyDefines"
}
Write-Host $env:Qt6_DIR
Write-Host $env:QT_PLUGIN_PATH
Write-Host $env:QML2_IMPORT_PATH
Write-Host $env:QT_HOST_PATH

# if ((qmake --version -split '\n')[1][17] -eq '6') {
# qmake QMAKE_APPLE_DEVICE_ARCHS="x86_64 arm64" $args[0] PREFIX=$Prefix DEFINES+="$env:nightlyDefines"
# } else {
# qmake $args[0] PREFIX=$Prefix DEFINES+="$env:nightlyDefines"
# }
& $env:Qt6_DIR\bin\qmake.bat $args[0] PREFIX=$Prefix DEFINES+="$env:nightlyDefines"

if ($IsWindows) {
nmake
Expand Down
11 changes: 8 additions & 3 deletions ci/scripts/vcvars.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Script assumes $env:arch will start with win64 or win32
# This should probably be an arg
$arch = $env:arch.substring(3, 2)
if ($env:arch.endswith('_arm64')) {
$arch = 'amd64_arm64'
} else {
# Script assumes $env:arch will start with win64 or win32
# This should probably be an arg
$arch = $env:arch.substring(3, 2)
}

$path = Resolve-Path "${env:ProgramFiles(x86)}\Microsoft Visual Studio\*\*\VC\Auxiliary\Build" | select -ExpandProperty Path

cmd.exe /c "call `"$path\vcvars$arch.bat`" && set > %temp%\vcvars.txt"
Expand Down
36 changes: 21 additions & 15 deletions ci/scripts/windeployqt.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,31 @@ param
$NightlyVersion = ""
)

# Download and extract openssl
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest https://www.firedaemon.com/download-firedaemon-openssl-1-zip -O openssl.zip
7z x -y .\openssl.zip
$IsArm64 = $env:arch.endswith('_arm64')

# Check if "arch" environment variable is win32
# If it is, install x86 binaries, otherwise x64 binaries
if ($env:arch.substring(3, 2) -eq '32') {
copy openssl-1.1\x86\bin\libssl-1_1.dll bin\
copy openssl-1.1\x86\bin\libcrypto-1_1.dll bin\
} Else {
copy openssl-1.1\x64\bin\libssl-1_1-x64.dll bin\
copy openssl-1.1\x64\bin\libcrypto-1_1-x64.dll bin\
if (-not $IsArm64) {
# Download and extract openssl
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest https://www.firedaemon.com/download-firedaemon-openssl-1-zip -O openssl.zip
7z x -y .\openssl.zip

# Check if "arch" environment variable is win32
# If it is, install x86 binaries, otherwise x64 binaries
if ($env:arch.substring(3, 2) -eq '32') {
copy openssl-1.1\x86\bin\libssl-1_1.dll bin\
copy openssl-1.1\x86\bin\libcrypto-1_1.dll bin\
} Else {
copy openssl-1.1\x64\bin\libssl-1_1-x64.dll bin\
copy openssl-1.1\x64\bin\libcrypto-1_1-x64.dll bin\
}
}

# Run windeployqt which should be in path
windeployqt bin/qView.exe --no-compiler-runtime

# Call innomake if we are not building a nightly version (no version passed)
if ($NightlyVersion -eq '') {
& "ci/scripts/innomake.ps1"
if (-not $IsArm64) {
# Call innomake if we are not building a nightly version (no version passed)
if ($NightlyVersion -eq '') {
& "ci/scripts/innomake.ps1"
}
}

0 comments on commit 3e5bb2a

Please sign in to comment.