File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -15,10 +15,13 @@ jobs:
1515
1616 - name : Check Formatting
1717 run : |
18- $VSDevCmd = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere" -latest -find Common7\tools\VSDevCmd.bat
19- if (!$VSDevCmd) { exit 1 }
20- Write-Host "Using VSDevCmd: ${VSDevCmd}"
21- & $VSDevCmd;
18+ $vcvars64 = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere" -latest -find VC\Auxiliary\Build\vcvars64.bat
19+ if (!$vcvars64) { exit 1 }
20+ Write-Host "Using vcvars64: ${vcvars64}"
21+
22+ # We need environment variables from running a batch file, but are running pwsh, so they would all be lost when cmd exits. We
23+ # circumvent this problem by launching a fresh pwsh process after the batch file runs so execution continues with them set.
24+ cmd "/k" '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" & pwsh'
2225
2326 & .\find_clang_format.cmd
2427 if ($LASTEXITCODE -ne 0) {
You can’t perform that action at this time.
0 commit comments