Skip to content

Commit 95a3950

Browse files
committed
Fix Windows CI Visual Studio setup
1 parent 82a1db4 commit 95a3950

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/ci-matrix-gen.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,19 @@ jobs:
260260
if: ${{ matrix.run_steps && runner.os == 'Windows' }}
261261
shell: cmd
262262
run: |
263-
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
263+
set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
264+
if not exist "%VSWHERE%" set "VSWHERE=C:\ProgramData\Chocolatey\bin\vswhere.exe"
265+
if not exist "%VSWHERE%" (
266+
echo Could not find vswhere.exe
267+
exit /b 1
268+
)
269+
for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath -latest`) do set "VS_INSTALL_DIR=%%i"
270+
if not defined VS_INSTALL_DIR (
271+
echo Could not find Visual Studio with VC tools
272+
exit /b 1
273+
)
274+
call "%VS_INSTALL_DIR%\VC\Auxiliary\Build\vcvarsall.bat" x64
275+
where dumpbin
264276
${{ matrix.run_steps }}
265277
266278
- name: Tar artifacts

0 commit comments

Comments
 (0)