mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
ci(win): use vswhere to automatically setup required vsdev env vars
This commit is contained in:
parent
921162a4b1
commit
2550212b25
15
ci/build.ps1
15
ci/build.ps1
@ -80,6 +80,16 @@ elseif ($compiler -eq 'MSVC') {
|
||||
$cmakeGenerator = 'Visual Studio 16 2019'
|
||||
}
|
||||
|
||||
if ($compiler -eq 'MSVC') {
|
||||
$installationPath = vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
|
||||
if ($installationPath -and (test-path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
|
||||
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=x${bits} -no_logo && set" | foreach-object {
|
||||
$name, $value = $_ -split '=', 2
|
||||
set-content env:\"$name" $value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $NoTests) {
|
||||
python -m ensurepip
|
||||
python -m pip install pynvim ; exitIfFailed
|
||||
@ -94,11 +104,6 @@ if (-not $NoTests) {
|
||||
npm.cmd link neovim
|
||||
}
|
||||
|
||||
if ($compiler -eq 'MSVC') {
|
||||
# Required for LuaRocks (https://github.com/luarocks/luarocks/issues/1039#issuecomment-507296940).
|
||||
$env:VCINSTALLDIR = "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/16.11.31729/"
|
||||
}
|
||||
|
||||
function convertToCmakeArgs($vars) {
|
||||
return $vars.GetEnumerator() | foreach { "-D$($_.Key)=$($_.Value)" }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user