Skip to content

Commit

Permalink
Fix macOS legacy build on newer GitHub runner
Browse files Browse the repository at this point in the history
  • Loading branch information
jdpurcell committed Apr 26, 2024
1 parent 0c91850 commit 0f777f3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- runner: 'macos-14'
qtVersion: '6.5.3'
qtModules: 'qtimageformats'
- runner: 'macos-12'
- runner: 'macos-14'
qtVersion: '5.15.2'
osSuffix: '_legacy'
- runner: 'windows-2022'
Expand Down
26 changes: 20 additions & 6 deletions dist/scripts/build.ps1
Original file line number Diff line number Diff line change
@@ -1,23 +1,37 @@
#!/usr/bin/env pwsh

param
(
param (
$Prefix = "/usr"
)

if ($IsWindows) {
dist/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"
$qtVersion = ((qmake --version -split '\n')[1] -split ' ')[3]
Write-Host "Detected Qt Version $qtVersion"

$qmakeArgs = @(
"PREFIX=""$Prefix""",
"DEFINES+=""$env:nightlyDefines"""
)

if ($IsMacOS) {
if ($qtVersion -like '5.*') {
# QTBUG-117225
$qmakeArgs += @("-early", "QMAKE_DEFAULT_LIBDIRS=""$(xcrun -show-sdk-path)/usr/lib""")
} else {
$qmakeArgs += "QMAKE_APPLE_DEVICE_ARCHS=""x86_64 arm64"""
}
}

Write-Host "Running 'qmake' w/ args: $qmakeArgs"
Invoke-Expression "qmake $qmakeArgs"

if ($IsWindows) {
Write-Host "Running 'nmake'"
nmake
} else {
Write-Host "Running 'make'"
make
}

0 comments on commit 0f777f3

Please sign in to comment.