build.ps1 - Remove incorrect $env:VS141COMNTOOLS -eq $null check when building VS2017

There is no such environment variable, VS2017 uses vswhere to locate the installed version.

Move checks into the MSVS function and make the error message consistent
This commit is contained in:
Alex Maitland
2019-02-22 11:11:32 +10:00
parent fc7a9a7672
commit 6209bbdcdf
+5 -11
View File
@@ -135,6 +135,10 @@ function Msvs
switch -Exact ($Toolchain) {
'v140' {
if($env:VS140COMNTOOLS -eq $null) {
Die "Visual Studio 2015 is not installed on your development machine, unable to continue."
}
$MSBuildExe = join-path -path (Get-ItemProperty "HKLM:\software\Microsoft\MSBuild\ToolsVersions\14.0").MSBuildToolsPath -childpath "msbuild.exe"
$MSBuildExe = $MSBuildExe -replace "Framework64", "Framework"
$VisualStudioVersion = '14.0'
@@ -168,7 +172,7 @@ function Msvs
if(-not (Test-Path $VS2017InstallPath))
{
Die "Visual Studio 2017 was not found"
Die "Visual Studio 2017 is not installed on your development machine, unable to continue."
}
$MSBuildExe = "msbuild.exe"
@@ -243,16 +247,6 @@ function VSX
[string] $Toolchain
)
if($Toolchain -eq 'v140' -and $env:VS140COMNTOOLS -eq $null) {
Warn "Toolchain $Toolchain is not installed on your development machine, skipping build."
Return
}
if($Toolchain -eq 'v141' -and $env:VS141COMNTOOLS -eq $null) {
Warn "Toolchain $Toolchain is not installed on your development machine, skipping build."
Return
}
Write-Diagnostic "Starting to build targeting toolchain $Toolchain"
Msvs "$Toolchain" 'Release' 'x86'