Merge VcpkgPowershellUtils into bootstrap.ps1

This commit is contained in:
Alexander Karatarakis 2018-05-19 17:54:50 -07:00
parent 555fa8d7cc
commit a739df905c
3 changed files with 25 additions and 28 deletions

View File

@ -1,25 +0,0 @@
function vcpkgHasProperty([Parameter(Mandatory=$true)][AllowNull()]$object, [Parameter(Mandatory=$true)]$propertyName)
{
if ($object -eq $null)
{
return $false
}
return [bool]($object.psobject.Properties | Where-Object { $_.Name -eq "$propertyName"})
}
function getProgramFiles32bit()
{
$out = ${env:PROGRAMFILES(X86)}
if ($out -eq $null)
{
$out = ${env:PROGRAMFILES}
}
if ($out -eq $null)
{
throw "Could not find [Program Files 32-bit]"
}
return $out
}

View File

@ -5,10 +5,33 @@ param(
)
Set-StrictMode -Version Latest
$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition
. "$scriptsDir\VcpkgPowershellUtils.ps1"
$vcpkgRootDir = $scriptsDir
$withVSPath = $withVSPath -replace "\\$" # Remove potential trailing backslash
function vcpkgHasProperty([Parameter(Mandatory=$true)][AllowNull()]$object, [Parameter(Mandatory=$true)]$propertyName)
{
if ($object -eq $null)
{
return $false
}
return [bool]($object.psobject.Properties | Where-Object { $_.Name -eq "$propertyName"})
}
function getProgramFiles32bit()
{
$out = ${env:PROGRAMFILES(X86)}
if ($out -eq $null)
{
$out = ${env:PROGRAMFILES}
}
if ($out -eq $null)
{
throw "Could not find [Program Files 32-bit]"
}
return $out
}
while (!($vcpkgRootDir -eq "") -and !(Test-Path "$vcpkgRootDir\.vcpkg-root"))
{

View File

@ -19,7 +19,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{F589
..\scripts\internalCI.ps1 = ..\scripts\internalCI.ps1
..\scripts\ports.cmake = ..\scripts\ports.cmake
..\scripts\SHA256Hash.ps1 = ..\scripts\SHA256Hash.ps1
..\scripts\VcpkgPowershellUtils.ps1 = ..\scripts\VcpkgPowershellUtils.ps1
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cmake", "cmake", "{A0122231-04D5-420B-81CA-7960946E5E65}"