diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2018-06-08 13:31:57 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2018-06-08 13:32:21 -0700 |
| commit | 9750fff02717a4e71a4765bdf10835d4d8706fdf (patch) | |
| tree | 8537ec663b7982a4bbdb72f7acfa63d6217e2e01 /scripts/bootstrap.ps1 | |
| parent | 47d904608c25988c1bf377b773059d93ad69f198 (diff) | |
| download | vcpkg-9750fff02717a4e71a4765bdf10835d4d8706fdf.tar.gz vcpkg-9750fff02717a4e71a4765bdf10835d4d8706fdf.zip | |
[bootstrap] Add option to specify WinSDK
Diffstat (limited to 'scripts/bootstrap.ps1')
| -rw-r--r-- | scripts/bootstrap.ps1 | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index d3ea2a6f2..5a6a41943 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -1,7 +1,8 @@ [CmdletBinding()] param( [ValidateNotNullOrEmpty()][string]$disableMetrics = "0", - [Parameter(Mandatory=$False)][string]$withVSPath = "" + [Parameter(Mandatory=$False)][string]$withVSPath = "", + [Parameter(Mandatory=$False)][string]$withWinSDK = "" ) Set-StrictMode -Version Latest $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition @@ -169,7 +170,8 @@ function findAnyMSBuildWithCppPlatformToolset([string]$withVSPath) throw "Could not find MSBuild version with C++ support. VS2015 or VS2017 (with C++) needs to be installed." } function getWindowsSDK( [Parameter(Mandatory=$False)][switch]$DisableWin10SDK = $False, - [Parameter(Mandatory=$False)][switch]$DisableWin81SDK = $False) + [Parameter(Mandatory=$False)][switch]$DisableWin81SDK = $False, + [Parameter(Mandatory=$False)][string]$withWinSDK) { if ($DisableWin10SDK -and $DisableWin81SDK) { @@ -270,6 +272,19 @@ function getWindowsSDK( [Parameter(Mandatory=$False)][switch]$DisableWin10SDK = } # Selecting + if ($withWinSDK -ne "") + { + foreach ($instance in $validInstances) + { + if ($instance -eq $withWinSDK) + { + return $instance + } + } + + throw "Could not find the requested Windows SDK version: $withWinSDK" + } + foreach ($instance in $validInstances) { if (!$DisableWin10SDK -and $instance -match "10.") @@ -289,7 +304,7 @@ function getWindowsSDK( [Parameter(Mandatory=$False)][switch]$DisableWin10SDK = $msbuildExeWithPlatformToolset = findAnyMSBuildWithCppPlatformToolset $withVSPath $msbuildExe = $msbuildExeWithPlatformToolset[0] $platformToolset = $msbuildExeWithPlatformToolset[1] -$windowsSDK = getWindowsSDK +$windowsSDK = getWindowsSDK -withWinSDK $withWinSDK $arguments = ( "`"/p:VCPKG_VERSION=-nohash`"", |
