Merge bitcoin/bitcoin#32184: ci: Add workaround for vcpkg's libevent package

30c59adda4 ci: Drop confusing comment (Hennadii Stepanov)
ef00a28414 ci: Add workaround for vcpkg's libevent package (Hennadii Stepanov)

Pull request description:

  This PR is necessary for Windows GHA [images](https://github.com/actions/runner-images/blob/win22/20250330.1/images/windows/Windows2022-Readme.md), which provide CMake >= 4.0.

  The idea has been taken from https://github.com/microsoft/vcpkg/pull/44273#discussion_r2009140242.

ACKs for top commit:
  maflcko:
    lgtm ACK 30c59adda4
  pinheadmz:
    ACK 30c59adda4

Tree-SHA512: 898a616a40c1aaec69d8a329d56f887cacec71b9588842feef2b689fbd21a12d8f8b3b4053a6373332008668960b9df7c71a44fcd97e637e250705daf1215c7f
This commit is contained in:
Hennadii Stepanov 2025-04-01 22:27:08 +01:00
commit 449e2eb7e4
No known key found for this signature in database
GPG key ID: 410108112E7EA81F

View file

@ -158,8 +158,6 @@ jobs:
windows-native:
name: ${{ matrix.job-name }}
# Use latest image, but hardcode version to avoid silent upgrades (and breaks).
# See: https://github.com/actions/runner-images#available-images.
runs-on: windows-2022
if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }}
@ -205,6 +203,8 @@ jobs:
run: |
echo "set(VCPKG_BUILD_TYPE release)" >> "${VCPKG_INSTALLATION_ROOT}/triplets/x64-windows.cmake"
echo "set(VCPKG_BUILD_TYPE release)" >> "${VCPKG_INSTALLATION_ROOT}/triplets/x64-windows-static.cmake"
# Workaround for libevent, which requires CMake 3.1 but is incompatible with CMake >= 4.0.
sed -i '1s/^/set(ENV{CMAKE_POLICY_VERSION_MINIMUM} 3.5)\n/' "${VCPKG_INSTALLATION_ROOT}/scripts/ports.cmake"
- name: vcpkg tools cache
uses: actions/cache@v4