Skip to content

Commit

Permalink
[Windows] Add VCPKG_ROOT variable (#6192)
Browse files Browse the repository at this point in the history
  • Loading branch information
erik-bershel authored Sep 8, 2022
1 parent 27d6979 commit a4b9a51
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions images/win/scripts/Installers/Install-Vcpkg.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ Invoke-Expression "$InstallDir\$VcpkgExecPath integrate install"
Add-MachinePathItem $InstallDir
$env:Path = Get-MachinePath
setx VCPKG_INSTALLATION_ROOT $InstallDir /M
setx VCPKG_ROOT $InstallDir /M

Invoke-PesterTests -TestFile "Tools" -TestName "Vcpkg"
4 changes: 4 additions & 0 deletions images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ function Build-PackageManagementEnvironmentTable {
@{
"Name" = "VCPKG_INSTALLATION_ROOT"
"Value" = $env:VCPKG_INSTALLATION_ROOT
},
@{
"Name" = "VCPKG_ROOT"
"Value" = $env:VCPKG_ROOT
}
)
if (Test-IsWin19) {
Expand Down
12 changes: 8 additions & 4 deletions images/win/scripts/Tests/Tools.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,19 @@ Describe "Stack" {

Describe "Vcpkg" {
It "vcpkg" {
"vcpkg version" | Should -ReturnZeroExitCode
"vcpkg version" | Should -ReturnZeroExitCode
}

It "env variable VCPKG_INSTALLATION_ROOT is set" {
$env:VCPKG_INSTALLATION_ROOT | Should -Not -BeNullOrEmpty
$env:VCPKG_INSTALLATION_ROOT | Should -Not -BeNullOrEmpty
}

It "VCPKG_INSTALLATION_ROOT directory" {
$env:VCPKG_INSTALLATION_ROOT | Should -Exist
It "env variable VCPKG_ROOT is set" {
$env:VCPKG_ROOT | Should -Not -BeNullOrEmpty
}

It "VCPKG_ROOT directory" {
$env:VCPKG_ROOT | Should -Exist
}
}

Expand Down

0 comments on commit a4b9a51

Please sign in to comment.