Skip to content

Commit e0ba495

Browse files
committed
Fix Windows, iOS, tvOS caching
1 parent c2ef01d commit e0ba495

File tree

2 files changed

+71
-48
lines changed

2 files changed

+71
-48
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,6 @@ jobs:
9696
# certificate-passphrase: ${{secrets.MACOS_CERTIFICATE_PASSWORD}}
9797
# keychain-password: ${{secrets.MACOS_KEYCHAIN_PASSWORD}}
9898

99-
- name: Verify CMake version
100-
run: cmake --version
101-
10299
- name: Upload artifacts
103100
uses: actions/upload-artifact@v6
104101
with:
@@ -123,21 +120,16 @@ jobs:
123120
brew upgrade --formula
124121
brew install cmake ninja
125122
pip3 install --break-system-packages markupsafe
123+
rustup target add aarch64-apple-ios
126124
127125
- name: Setup sccache
128126
uses: mozilla-actions/sccache-action@v0.0.9
129127

130-
- name: Install Rust iOS target
131-
run: rustup target add aarch64-apple-ios
132-
133-
- name: Verify CMake version
134-
run: cmake --version
135-
136128
- name: Configure CMake
137-
run: cmake --preset ios-default
129+
run: cmake --preset x-ios-ci
138130

139131
- name: Build
140-
run: cmake --build --preset ios-default --target install
132+
run: cmake --build --preset x-ios-ci --target install
141133

142134
- name: Upload artifacts
143135
uses: actions/upload-artifact@v6
@@ -163,23 +155,17 @@ jobs:
163155
brew upgrade --formula
164156
brew install cmake ninja
165157
pip3 install --break-system-packages markupsafe
166-
167-
- name: Setup sccache
168-
uses: mozilla-actions/sccache-action@v0.0.9
169-
170-
- name: Install Rust nightly + tvOS target
171-
run: |
172158
rustup toolchain install nightly
173159
rustup target add --toolchain nightly aarch64-apple-tvos
174160
175-
- name: Verify CMake version
176-
run: cmake --version
161+
- name: Setup sccache
162+
uses: mozilla-actions/sccache-action@v0.0.9
177163

178164
- name: Configure CMake
179-
run: cmake --preset tvos-default
165+
run: cmake --preset x-tvos-ci
180166

181167
- name: Build
182-
run: cmake --build --preset tvos-default --target install
168+
run: cmake --build --preset x-tvos-ci --target install
183169

184170
- name: Upload artifacts
185171
uses: actions/upload-artifact@v6
@@ -211,20 +197,21 @@ jobs:
211197
fetch-depth: 0
212198
submodules: recursive
213199

214-
- name: Install dependencies
215-
run: choco install ninja
216-
217-
- name: Setup sccache
218-
uses: mozilla-actions/sccache-action@v0.0.9
219-
220200
- name: Enable Visual Studio environment
221201
uses: ilammy/msvc-dev-cmd@v1
222202

203+
# msvc-dev-cmd sets VCPKG_ROOT, set it back
223204
- name: Override VCPKG_ROOT
224205
run: echo "VCPKG_ROOT=C:\vcpkg" >> $env:GITHUB_ENV
225206

226-
- name: Install vcpkg packages
227-
run: vcpkg install zlib:x64-windows-static bzip2:x64-windows-static zstd:x64-windows-static liblzma:x64-windows-static freetype:x64-windows-static
207+
- name: Setup sccache
208+
uses: mozilla-actions/sccache-action@v0.0.9
209+
210+
- name: Install dependencies
211+
run: |
212+
choco install ninja
213+
vcpkg install zlib:x64-windows-static bzip2:x64-windows-static zstd:x64-windows-static \
214+
liblzma:x64-windows-static freetype:x64-windows-static
228215
229216
- name: Configure CMake
230217
run: cmake --preset x-windows-ci-${{matrix.preset}}

CMakePresets.json

Lines changed: 55 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@
238238
"displayName": "iOS",
239239
"generator": "Ninja",
240240
"binaryDir": "${sourceDir}/build/${presetName}",
241+
"inherits": [
242+
"relwithdebinfo"
243+
],
241244
"cacheVariables": {
242245
"CMAKE_TOOLCHAIN_FILE": "ios.toolchain.cmake",
243246
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install",
@@ -282,6 +285,9 @@
282285
"displayName": "tvOS",
283286
"generator": "Ninja",
284287
"binaryDir": "${sourceDir}/build/${presetName}",
288+
"inherits": [
289+
"relwithdebinfo"
290+
],
285291
"cacheVariables": {
286292
"CMAKE_TOOLCHAIN_FILE": "ios.toolchain.cmake",
287293
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install",
@@ -327,18 +333,13 @@
327333
"hidden": true,
328334
"generator": "Ninja",
329335
"binaryDir": "${sourceDir}/build/${presetName}",
336+
"inherits": [
337+
"relwithdebinfo"
338+
],
330339
"cacheVariables": {
331-
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
332340
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install",
333341
"CMAKE_TOOLCHAIN_FILE": "$env{ANDROID_HOME}/ndk/$env{ANDROID_NDK_VERSION}/build/cmake/android.toolchain.cmake",
334342
"ANDROID_PLATFORM": "android-24"
335-
},
336-
"vendor": {
337-
"microsoft.com/VisualStudioSettings/CMake/1.0": {
338-
"hostOS": [
339-
"Linux"
340-
]
341-
}
342343
}
343344
},
344345
{
@@ -396,6 +397,26 @@
396397
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache"
397398
}
398399
},
400+
{
401+
"name": "x-ios-ci",
402+
"inherits": [
403+
"ios-default"
404+
],
405+
"cacheVariables": {
406+
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
407+
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache"
408+
}
409+
},
410+
{
411+
"name": "x-tvos-ci",
412+
"inherits": [
413+
"tvos-default"
414+
],
415+
"cacheVariables": {
416+
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
417+
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache"
418+
}
419+
},
399420
{
400421
"name": "x-windows-ci",
401422
"hidden": true,
@@ -405,7 +426,9 @@
405426
"binaryDir": "$env{BUILD_DIR}",
406427
"cacheVariables": {
407428
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
408-
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache"
429+
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache",
430+
"CMAKE_MSVC_DEBUG_INFORMATION_FORMAT": "Embedded",
431+
"CMAKE_POLICY_CMP0141": "NEW"
409432
}
410433
},
411434
{
@@ -539,8 +562,7 @@
539562
"displayName": "(Internal) Linux CI GCC",
540563
"targets": [
541564
"install"
542-
],
543-
"verbose": true
565+
]
544566
},
545567
{
546568
"name": "x-linux-ci-clang",
@@ -549,8 +571,7 @@
549571
"displayName": "(Internal) Linux CI Clang",
550572
"targets": [
551573
"install"
552-
],
553-
"verbose": true
574+
]
554575
},
555576
{
556577
"name": "x-macos-ci",
@@ -559,8 +580,25 @@
559580
"displayName": "(Internal) macOS CI",
560581
"targets": [
561582
"install"
562-
],
563-
"verbose": true
583+
]
584+
},
585+
{
586+
"name": "x-ios-ci",
587+
"configurePreset": "x-ios-ci",
588+
"description": "(Internal) iOS CI",
589+
"displayName": "(Internal) iOS CI",
590+
"targets": [
591+
"install"
592+
]
593+
},
594+
{
595+
"name": "x-tvos-ci",
596+
"configurePreset": "x-tvos-ci",
597+
"description": "(Internal) tvOS CI",
598+
"displayName": "(Internal) tvOS CI",
599+
"targets": [
600+
"install"
601+
]
564602
},
565603
{
566604
"name": "x-windows-ci-msvc",
@@ -569,8 +607,7 @@
569607
"displayName": "(Internal) Windows CI MSVC",
570608
"targets": [
571609
"install"
572-
],
573-
"verbose": true
610+
]
574611
},
575612
{
576613
"name": "x-windows-ci-clang",
@@ -579,8 +616,7 @@
579616
"displayName": "(Internal) Windows CI Clang",
580617
"targets": [
581618
"install"
582-
],
583-
"verbose": true
619+
]
584620
}
585621
]
586622
}

0 commit comments

Comments
 (0)