mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 18:31:15 +08:00
Exit early if no VS is found
This commit is contained in:
parent
0aa1bfe293
commit
fdf7c65aa4
@ -46,7 +46,7 @@ try
|
||||
& $msbuildExe "/p:VCPKG_VERSION=-$gitHash" "/p:DISABLE_METRICS=$disableMetrics" /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=$platformToolset /p:TargetPlatformVersion=$windowsSDK /m dirs.proj
|
||||
if ($LASTEXITCODE -ne 0)
|
||||
{
|
||||
Write-Error "Building vcpkg.exe failed. Please ensure you have installed the Desktop C++ workload and the Windows SDK for Desktop C++."
|
||||
Write-Error "Building vcpkg.exe failed. Please ensure you have installed Visual Studio with the Desktop C++ workload and the Windows SDK for Desktop C++."
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,11 @@ $withVSPath = $withVSPath -replace "\\$" # Remove potential trailing backslash
|
||||
|
||||
$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition
|
||||
$VisualStudioInstallationInstances = & $scriptsDir\findVisualStudioInstallationInstances.ps1
|
||||
if ($VisualStudioInstallationInstances -eq $null)
|
||||
{
|
||||
throw "Could not find Visual Studio. VS2015 or VS2017 (with C++) needs to be installed."
|
||||
}
|
||||
|
||||
Write-Verbose "VS Candidates:`n`r$([system.String]::Join([Environment]::NewLine, $VisualStudioInstallationInstances))"
|
||||
foreach ($instanceCandidateWithEOL in $VisualStudioInstallationInstances)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user