Skip to content

Commit

Permalink
Update vcpkg to latest version
Browse files Browse the repository at this point in the history
- Switch to using x64-windows-release triplet instead of modifying x64-windows
- Create custom x86-windows-release triplet in windows subdirectory as this is not provided by vcpkg
  • Loading branch information
ajtribick committed Oct 25, 2024
1 parent 87ed754 commit 25452e5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
42 changes: 19 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,20 @@ jobs:
platform: [ x64, x86 ]

steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
submodules: true

- name: Update vcpkg
shell: pwsh
run: |
$vcpkgCommit = '1fc46db8b9b963ed3a26c619b68de76edb52061a'
$vcpkgCommit = 'cff6ed45719c0162fa7065fdac90506a0add812c'
pushd "$env:VCPKG_INSTALLATION_ROOT"
git cat-file -e "${vcpkgCommit}^{commit}" 2> $null
if (!$?) {
git pull
}
git -c advice.detachedHead=false checkout $vcpkgCommit
if (!$?) {
throw "Could not check out commit $vcpkgCommit"
}
git fetch origin $vcpkgCommit
git reset --hard $vcpkgCommit
./bootstrap-vcpkg.bat
Get-ChildItem -Path 'triplets\*-windows*.cmake' | ForEach-Object {
Add-Content -Path $_ -Value 'set(VCPKG_BUILD_TYPE "release")'
}
./vcpkg.exe integrate install
popd
- name: Setup NuGet Credentials
Expand Down Expand Up @@ -83,19 +80,17 @@ jobs:
# differ if we enable arm64-windows builds in future
if ( '${{matrix.platform}}' -eq 'x86' ) {
$hostTriplet = 'x86-windows'
$hostTriplet = 'x86-windows-release'
} else {
$hostTriplet = 'x64-windows'
$hostTriplet = 'x64-windows-release'
}
vcpkg --triplet=${{matrix.platform}}-windows `
--host-triplet=$hostTriplet `
install --recurse @packages
- name: Checkout source code
uses: actions/checkout@v4
with:
submodules: true
pushd "$env:VCPKG_INSTALLATION_ROOT"
./vcpkg.exe --overlay-triplets=${{github.workspace}}/windows/vcpkg-triplets `
--triplet=${{matrix.platform}}-windows-release `
--host-triplet=$hostTriplet `
install --recurse @packages
popd
- name: Configure CMake
shell: pwsh
Expand All @@ -108,7 +103,8 @@ jobs:
cmake -B '${{github.workspace}}/build' `
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=${{matrix.platform}}-windows `
-DVCPKG_OVERLAY_TRIPLETS="${{github.workspace}}/windows/vcpkg-triplets" `
-DVCPKG_TARGET_TRIPLET=${{matrix.platform}}-windows-release `
-DCMAKE_GENERATOR_PLATFORM="$GeneratorPlatform" `
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install" `
-DENABLE_SPICE=ON `
Expand Down
4 changes: 4 additions & 0 deletions windows/vcpkg-triplets/x86-windows-release.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(VCPKG_TARGET_ARCHITECTURE x86)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_BUILD_TYPE release)

0 comments on commit 25452e5

Please sign in to comment.