diff options
-rw-r--r-- | ci/build.ps1 | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/ci/build.ps1 b/ci/build.ps1 index ba80251013..0953a708c8 100644 --- a/ci/build.ps1 +++ b/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)" } } |