aboutsummaryrefslogtreecommitdiff
path: root/scripts/bootstrap.ps1
diff options
context:
space:
mode:
authorGriffin Downs <grdowns@microsoft.com>2019-02-27 16:44:17 -0800
committerGriffin Downs <grdowns@microsoft.com>2019-02-27 16:44:17 -0800
commit1908903508bf057ad05d8a344e5bc55477944cb6 (patch)
tree2a23595f1e7d8cc9a6358bfd44a00eb7368d8a1b /scripts/bootstrap.ps1
parentb0a2ff18c9f2c9131aed131f5bf0d97c0e23da8e (diff)
parent8564602d06d7c4ce236f96a4f0f3ba7c2d769cb0 (diff)
downloadvcpkg-1908903508bf057ad05d8a344e5bc55477944cb6.tar.gz
vcpkg-1908903508bf057ad05d8a344e5bc55477944cb6.zip
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/grdowns/4802
Diffstat (limited to 'scripts/bootstrap.ps1')
-rw-r--r--scripts/bootstrap.ps126
1 files changed, 18 insertions, 8 deletions
diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1
index ed82a6ab1..07a9fcbaa 100644
--- a/scripts/bootstrap.ps1
+++ b/scripts/bootstrap.ps1
@@ -25,7 +25,7 @@ $withVSPath = $withVSPath -replace "\\$" # Remove potential trailing backslash
function vcpkgHasProperty([Parameter(Mandatory=$true)][AllowNull()]$object, [Parameter(Mandatory=$true)]$propertyName)
{
- if ($object -eq $null)
+ if ($null -eq $object)
{
return $false
}
@@ -36,12 +36,12 @@ function vcpkgHasProperty([Parameter(Mandatory=$true)][AllowNull()]$object, [Par
function getProgramFiles32bit()
{
$out = ${env:PROGRAMFILES(X86)}
- if ($out -eq $null)
+ if ($null -eq $out)
{
$out = ${env:PROGRAMFILES}
}
- if ($out -eq $null)
+ if ($null -eq $out)
{
throw "Could not find [Program Files 32-bit]"
}
@@ -138,7 +138,7 @@ function getVisualStudioInstances()
function findAnyMSBuildWithCppPlatformToolset([string]$withVSPath)
{
$VisualStudioInstances = getVisualStudioInstances
- if ($VisualStudioInstances -eq $null)
+ if ($null -eq $VisualStudioInstances)
{
throw "Could not find Visual Studio. VS2015 or VS2017 (with C++) needs to be installed."
}
@@ -160,6 +160,16 @@ function findAnyMSBuildWithCppPlatformToolset([string]$withVSPath)
}
$majorVersion = $version.Substring(0,2);
+ if ($majorVersion -eq "16")
+ {
+ $VCFolder= "$path\VC\Tools\MSVC\"
+ if (Test-Path $VCFolder)
+ {
+ Write-Verbose "Picking: $instanceCandidate"
+ return "$path\MSBuild\Current\Bin\MSBuild.exe", "v142"
+ }
+ }
+
if ($majorVersion -eq "15")
{
$VCFolder= "$path\VC\Tools\MSVC\"
@@ -182,7 +192,7 @@ function findAnyMSBuildWithCppPlatformToolset([string]$withVSPath)
}
}
- throw "Could not find MSBuild version with C++ support. VS2015 or VS2017 (with C++) needs to be installed."
+ throw "Could not find MSBuild version with C++ support. VS2015, VS2017, or VS2019 (with C++) needs to be installed."
}
function getWindowsSDK( [Parameter(Mandatory=$False)][switch]$DisableWin10SDK = $False,
[Parameter(Mandatory=$False)][switch]$DisableWin81SDK = $False,
@@ -200,7 +210,7 @@ function getWindowsSDK( [Parameter(Mandatory=$False)][switch]$DisableWin10SDK =
# Windows 10 SDK
function CheckWindows10SDK($path)
{
- if ($path -eq $null)
+ if ($null -eq $path)
{
return
}
@@ -252,7 +262,7 @@ function getWindowsSDK( [Parameter(Mandatory=$False)][switch]$DisableWin10SDK =
# Windows 8.1 SDK
function CheckWindows81SDK($path)
{
- if ($path -eq $null)
+ if ($null -eq $path)
{
return
}
@@ -386,7 +396,7 @@ if ($ec -ne 0)
}
Write-Host "`nBuilding vcpkg.exe... done.`n"
-Write-Verbose("Placing vcpkg.exe in the correct location")
+Write-Verbose "Placing vcpkg.exe in the correct location"
Copy-Item "$vcpkgReleaseDir\vcpkg.exe" "$vcpkgRootDir\vcpkg.exe"
Copy-Item "$vcpkgReleaseDir\vcpkgmetricsuploader.exe" "$vcpkgRootDir\scripts\vcpkgmetricsuploader.exe"