Skip to content

Commit 1a889f7

Browse files
committed
ci: Set MSVC toolset version explicitly
This change avoids toolset incompatibilities that cause linker errors.
1 parent 4335e55 commit 1a889f7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ jobs:
197197
run: |
198198
msbuild -version | Out-File -FilePath "$env:GITHUB_WORKSPACE\msbuild_version"
199199
Get-Content -Path "$env:GITHUB_WORKSPACE\msbuild_version"
200+
$env:VCToolsVersion | Out-File -FilePath "$env:GITHUB_WORKSPACE\toolset_version"
201+
Get-Content -Path "$env:GITHUB_WORKSPACE\toolset_version"
200202
$env:CI_QT_URL | Out-File -FilePath "$env:GITHUB_WORKSPACE\qt_url"
201203
$env:CI_QT_CONF | Out-File -FilePath "$env:GITHUB_WORKSPACE\qt_conf"
202204
@@ -279,6 +281,7 @@ jobs:
279281
run: |
280282
Set-Location "$env:VCPKG_INSTALLATION_ROOT"
281283
Add-Content -Path "triplets\x64-windows-static.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
284+
Add-Content -Path "triplets\x64-windows-static.cmake" -Value "set(VCPKG_PLATFORM_TOOLSET_VERSION $env:VCToolsVersion)"
282285
.\vcpkg.exe --vcpkg-root "$env:VCPKG_INSTALLATION_ROOT" integrate install
283286
git rev-parse HEAD | Out-File -FilePath "$env:GITHUB_WORKSPACE\vcpkg_commit"
284287
Get-Content -Path "$env:GITHUB_WORKSPACE\vcpkg_commit"
@@ -293,7 +296,7 @@ jobs:
293296
uses: actions/cache@v3
294297
with:
295298
path: ~/AppData/Local/vcpkg/archives
296-
key: ${{ github.job }}-vcpkg-binary-${{ hashFiles('vcpkg_commit', 'msbuild_version', 'build_msvc/vcpkg.json') }}
299+
key: ${{ github.job }}-vcpkg-binary-${{ hashFiles('vcpkg_commit', 'msbuild_version', 'toolset_version', 'build_msvc/vcpkg.json') }}
297300

298301
- name: Generate project files
299302
run: py -3 build_msvc\msvc-autogen.py

0 commit comments

Comments
 (0)