|
86 | 86 | rust: stable
|
87 | 87 | target: x86_64-apple-ios-macabi
|
88 | 88 | no_run: --no-run # FIXME(madsmtm): Fix running tests
|
| 89 | + - build: cross-macos-aarch64 |
| 90 | + os: ubuntu-latest |
| 91 | + rust: stable |
| 92 | + target: aarch64-apple-darwin |
| 93 | + no_run: --no-run |
| 94 | + - build: cross-ios-aarch64 |
| 95 | + os: ubuntu-latest |
| 96 | + rust: stable |
| 97 | + target: aarch64-apple-ios |
| 98 | + no_run: --no-run |
89 | 99 | - build: windows-aarch64
|
90 | 100 | os: windows-latest
|
91 | 101 | rust: stable
|
@@ -155,6 +165,31 @@ jobs:
|
155 | 165 | env:
|
156 | 166 | CC: ${{ matrix.CC }}
|
157 | 167 | CXX: ${{ matrix.CXX }}
|
| 168 | + - name: Install llvm tools (for llvm-ar) |
| 169 | + if: startsWith(matrix.build, 'cross-macos') || startsWith(matrix.build, 'cross-ios') |
| 170 | + run: sudo apt-get install llvm |
| 171 | + - name: Download macOS SDK |
| 172 | + if: startsWith(matrix.build, 'cross-macos') |
| 173 | + run: | |
| 174 | + wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.3.sdk.tar.xz |
| 175 | + tar -xf MacOSX11.3.sdk.tar.xz |
| 176 | + echo "SDKROOT=$(pwd)/MacOSX11.3.sdk" >> $GITHUB_ENV |
| 177 | + - name: Download iOS SDK |
| 178 | + if: startsWith(matrix.build, 'cross-ios') |
| 179 | + run: | |
| 180 | + wget https://github.com/xybp888/iOS-SDKs/releases/download/iOS18.1-SDKs/iPhoneOS18.1.sdk.zip |
| 181 | + unzip iPhoneOS18.1.sdk.zip |
| 182 | + echo "SDKROOT=$(pwd)/iPhoneOS18.1.sdk" >> $GITHUB_ENV |
| 183 | + - name: Set up Apple cross-compilation |
| 184 | + if: startsWith(matrix.build, 'cross-macos') || startsWith(matrix.build, 'cross-ios') |
| 185 | + run: | |
| 186 | + # Test with clang/llvm for now, has better cross-compilation support (GCC requires downloading a different toolchain) |
| 187 | + echo "CC=clang" >> $GITHUB_ENV |
| 188 | + echo "CXX=clang++" >> $GITHUB_ENV |
| 189 | + echo "AR=llvm-ar" >> $GITHUB_ENV |
| 190 | + # Link with rust-lld |
| 191 | + UPPERCASE_TARGET_NAME=$(echo "${{ matrix.target }}" | tr '[:lower:]-' '[:upper:]_') |
| 192 | + echo "CARGO_TARGET_${UPPERCASE_TARGET_NAME}_LINKER=rust-lld" >> $GITHUB_ENV |
158 | 193 | - name: setup dev environment
|
159 | 194 | uses: ilammy/msvc-dev-cmd@v1
|
160 | 195 | if: startsWith(matrix.build, 'windows-clang')
|
|
0 commit comments