diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 044c0046..cc01aecf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,17 +15,17 @@ jobs: strategy: matrix: include: - - runner: 'ubuntu-20.04' - qtVersion: '5.15.2' - buildArch: 'X64' - - runner: 'macos-14' - qtVersion: '6.8.1' - qtModules: 'qtimageformats' - buildArch: 'Universal' - - runner: 'macos-13' - qtVersion: '5.15.2' - osSuffix: '_legacy' - buildArch: 'X64' + # - runner: 'ubuntu-20.04' + # qtVersion: '5.15.2' + # buildArch: 'X64' + # - runner: 'macos-14' + # qtVersion: '6.8.1' + # qtModules: 'qtimageformats' + # buildArch: 'Universal' + # - runner: 'macos-13' + # qtVersion: '5.15.2' + # osSuffix: '_legacy' + # buildArch: 'X64' - runner: 'windows-2022' qtVersion: '6.8.1' qtArch: 'win64_msvc2022_64' diff --git a/dist/scripts/vcvars.ps1 b/dist/scripts/vcvars.ps1 index 192d061c..8754fd76 100755 --- a/dist/scripts/vcvars.ps1 +++ b/dist/scripts/vcvars.ps1 @@ -13,13 +13,13 @@ if (-not $arch) { throw 'Unsupported build architecture.' } -$path = Resolve-Path "${env:ProgramFiles}\Microsoft Visual Studio\*\*\VC\Auxiliary\Build" | Select-Object -ExpandProperty Path - -cmd.exe /c "call `"$path\vcvarsall.bat`" $arch && set > %temp%\vcvars.txt" +$vsPath = & vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath $exclusions = @('VCPKG_ROOT') -Get-Content "$env:temp\vcvars.txt" | Foreach-Object { - if ($_ -match "^(.*?)=(.*)$" -and $matches[1] -notin $exclusions) { - [Environment]::SetEnvironmentVariable($matches[1], $matches[2]) + +& cmd /c "`"$(Join-Path $vsPath 'VC\Auxiliary\Build\vcvarsall.bat')`" $vcBuildArch > null && set" | ForEach-Object { + $name, $value = $_ -Split '=', 2 + if ($name -notin $exclusions) { + [Environment]::SetEnvironmentVariable($name, $value) } }