ci: Set MSVC toolset version explicitly

This change avoids toolset incompatibilities that cause linker errors.
pull/28934/head
Hennadii Stepanov 12 months ago
parent 4335e55359
commit 1a889f7ea0
No known key found for this signature in database
GPG Key ID: 410108112E7EA81F

@ -197,6 +197,8 @@ jobs:
run: | run: |
msbuild -version | Out-File -FilePath "$env:GITHUB_WORKSPACE\msbuild_version" msbuild -version | Out-File -FilePath "$env:GITHUB_WORKSPACE\msbuild_version"
Get-Content -Path "$env:GITHUB_WORKSPACE\msbuild_version" Get-Content -Path "$env:GITHUB_WORKSPACE\msbuild_version"
$env:VCToolsVersion | Out-File -FilePath "$env:GITHUB_WORKSPACE\toolset_version"
Get-Content -Path "$env:GITHUB_WORKSPACE\toolset_version"
$env:CI_QT_URL | Out-File -FilePath "$env:GITHUB_WORKSPACE\qt_url" $env:CI_QT_URL | Out-File -FilePath "$env:GITHUB_WORKSPACE\qt_url"
$env:CI_QT_CONF | Out-File -FilePath "$env:GITHUB_WORKSPACE\qt_conf" $env:CI_QT_CONF | Out-File -FilePath "$env:GITHUB_WORKSPACE\qt_conf"
@ -279,6 +281,7 @@ jobs:
run: | run: |
Set-Location "$env:VCPKG_INSTALLATION_ROOT" Set-Location "$env:VCPKG_INSTALLATION_ROOT"
Add-Content -Path "triplets\x64-windows-static.cmake" -Value "set(VCPKG_BUILD_TYPE release)" Add-Content -Path "triplets\x64-windows-static.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
Add-Content -Path "triplets\x64-windows-static.cmake" -Value "set(VCPKG_PLATFORM_TOOLSET_VERSION $env:VCToolsVersion)"
.\vcpkg.exe --vcpkg-root "$env:VCPKG_INSTALLATION_ROOT" integrate install .\vcpkg.exe --vcpkg-root "$env:VCPKG_INSTALLATION_ROOT" integrate install
git rev-parse HEAD | Out-File -FilePath "$env:GITHUB_WORKSPACE\vcpkg_commit" git rev-parse HEAD | Out-File -FilePath "$env:GITHUB_WORKSPACE\vcpkg_commit"
Get-Content -Path "$env:GITHUB_WORKSPACE\vcpkg_commit" Get-Content -Path "$env:GITHUB_WORKSPACE\vcpkg_commit"
@ -293,7 +296,7 @@ jobs:
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: ~/AppData/Local/vcpkg/archives path: ~/AppData/Local/vcpkg/archives
key: ${{ github.job }}-vcpkg-binary-${{ hashFiles('vcpkg_commit', 'msbuild_version', 'build_msvc/vcpkg.json') }} key: ${{ github.job }}-vcpkg-binary-${{ hashFiles('vcpkg_commit', 'msbuild_version', 'toolset_version', 'build_msvc/vcpkg.json') }}
- name: Generate project files - name: Generate project files
run: py -3 build_msvc\msvc-autogen.py run: py -3 build_msvc\msvc-autogen.py

Loading…
Cancel
Save