Skip to content

Commit 3f65273

Browse files
committed
fix: cross-compile x86_64 on arm64 runner since macos-13 is no longer available
GitHub Actions deprecated the macos-13 runner. Use macos-latest (arm64) with jurplel/install-qt-action clang_64 to install x86_64 Qt libraries, then set CMAKE_OSX_ARCHITECTURES=x86_64 for cross-compilation to Intel target.
1 parent 5ea1d6d commit 3f65273

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

.github/workflows/macos-build.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,19 +101,23 @@ jobs:
101101

102102
build-mac-x86_64:
103103
name: macOS x86_64 (Intel)
104-
runs-on: macos-13
104+
runs-on: macos-latest
105105
outputs:
106106
artifact-name: ${{ steps.set-artifact.outputs.name }}
107107

108108
steps:
109109
- name: Checkout
110110
uses: actions/checkout@v4
111111

112-
- name: Install Qt6 (x86_64)
113-
run: |
114-
brew install qt@6
115-
echo "QTDIR=$(brew --prefix qt@6)" >> "$GITHUB_ENV"
116-
echo "$(brew --prefix qt@6)/bin" >> "$GITHUB_PATH"
112+
- name: Install Qt6 (x86_64 via aqtinstall)
113+
uses: jurplel/install-qt-action@v4
114+
with:
115+
version: '6.8.*'
116+
target: 'desktop'
117+
arch: 'clang_64'
118+
host: 'mac'
119+
cache: true
120+
cache-key-prefix: 'install-qt6-macos-x86_64'
117121

118122
- name: Cache CMake build
119123
uses: actions/cache@v4
@@ -126,7 +130,8 @@ jobs:
126130
run: |
127131
cmake -B build \
128132
-DCMAKE_BUILD_TYPE=Release \
129-
-DCMAKE_PREFIX_PATH="$QTDIR" \
133+
-DCMAKE_PREFIX_PATH="$QT_ROOT_DIR" \
134+
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
130135
-DBUILD_FILTER_GENERATOR=ON \
131136
-DBUILD_EXAMPLES=OFF \
132137
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON

0 commit comments

Comments
 (0)