diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 deleted file mode 100644 index 259df4acb6..0000000000 --- a/scripts/VcpkgPowershellUtils.ps1 +++ /dev/null @@ -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 -} \ No newline at end of file diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index a2d9103dd6..09c138bb34 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -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")) { diff --git a/toolsrc/vcpkg.sln b/toolsrc/vcpkg.sln index 3d12aafaf3..8155e0882e 100644 --- a/toolsrc/vcpkg.sln +++ b/toolsrc/vcpkg.sln @@ -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}"