Files
third_party_mesa3d/.gitlab-ci/windows/mesa_init_msvc.ps1
Yonggang Luo 5109790cf9 ci/msvc: Install both msvc2019 and msvc2022
Currently only msvc2019 are used

This is did intentionally, so we have a history script install msvc2019 only within vs2022

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26736>
2023-12-24 11:46:43 +00:00

18 lines
936 B
PowerShell

$vsInstallPath=& "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -version 16.0 -property installationpath
Write-Output "vswhere.exe installPath: $vsInstallPath"
$vsInstallPath = if ("$vsInstallPath" -eq "" ) { "C:\BuildTools" } else { "$vsInstallPath" }
Write-Output "Final installPath: $vsInstallPath"
Import-Module (Join-Path $vsInstallPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
# https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B
# VS2015 14.0 use -vcvars_ver=14.0
# VS2017 14.1 to 14.16 use -vcvars_ver=14.16
# VS2019 14.20 to 14.29 use -vcvars_ver=14.29
# VS2022 14.30 to 14.38 (not finished yet) use -vcvars_ver=14 to choose the newest version
$vcvars_ver_arg=$args
if ($null -eq $vcvars_ver_arg[0]) {
$vcvars_ver_arg="-vcvars_ver=14.29"
}
Enter-VsDevShell -VsInstallPath $vsInstallPath -SkipAutomaticLocation -DevCmdArguments "$vcvars_ver_arg -arch=x64 -no_logo -host_arch=amd64"