2019-12-13 09:48:00 -05:00
|
|
|
################################################################################
|
|
|
|
|
## File: Install-Vcpkg.ps1
|
|
|
|
|
## Desc: Install vcpkg
|
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
|
|
$Uri = 'https://github.com/Microsoft/vcpkg.git'
|
|
|
|
|
$InstallDir = 'C:\vcpkg'
|
|
|
|
|
$VcpkgExecPath = 'vcpkg.exe'
|
|
|
|
|
|
2021-11-11 00:54:32 -08:00
|
|
|
git clone $Uri $InstallDir -q
|
2019-12-13 09:48:00 -05:00
|
|
|
|
|
|
|
|
# Build and integrate vcpkg
|
|
|
|
|
Invoke-Expression "$InstallDir\bootstrap-vcpkg.bat"
|
2023-12-11 22:23:36 +01:00
|
|
|
if ($LASTEXITCODE -ne 0) {
|
|
|
|
|
throw "vcpkg bootstrap failed with exit code $LASTEXITCODE"
|
|
|
|
|
}
|
2019-12-13 09:48:00 -05:00
|
|
|
Invoke-Expression "$InstallDir\$VcpkgExecPath integrate install"
|
2023-12-11 22:23:36 +01:00
|
|
|
if ($LASTEXITCODE -ne 0) {
|
|
|
|
|
throw "vcpkg integration failed with exit code $LASTEXITCODE"
|
|
|
|
|
}
|
2019-12-13 09:48:00 -05:00
|
|
|
|
|
|
|
|
# Add vcpkg to system environment
|
|
|
|
|
Add-MachinePathItem $InstallDir
|
2023-11-17 13:52:52 +01:00
|
|
|
[Environment]::SetEnvironmentVariable("VCPKG_INSTALLATION_ROOT", $InstallDir, "Machine")
|
2023-11-29 13:00:16 +01:00
|
|
|
Update-Environment
|
2020-07-30 12:12:49 +05:00
|
|
|
|
|
|
|
|
Invoke-PesterTests -TestFile "Tools" -TestName "Vcpkg"
|