From 89b5addd1067bff2b2477910acbef1deee31a050 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Sat, 6 Dec 2025 22:26:24 +0100 Subject: [PATCH] Fix vcpkg build --- .github/workflows/ci.yml | 65 +++++++++++++++++++++++++++++----------- 1 file changed, 48 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d74b2684..c7d442aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,39 +113,70 @@ jobs: - arch: x64 backend: openssl target-platform: x64 + vcpkg-triplet: x64-windows build-options: - arch: x64 backend: botan target-platform: x64 + vcpkg-triplet: x64-windows build-options: -DENABLE_ECC=OFF -DENABLE_EDDSA=OFF - arch: x86 backend: openssl target-platform: Win32 + vcpkg-triplet: x86-windows build-options: -DENABLE_ECC=OFF -DENABLE_EDDSA=OFF + env: + VCPKG_DEFAULT_TRIPLET: ${{ matrix.vcpkg-triplet }} steps: - uses: actions/checkout@v4 + - uses: ilammy/msvc-dev-cmd@v1 with: arch: ${{ matrix.arch }} + + - name: Setup vcpkg + run: | + git clone https://github.com/Microsoft/vcpkg.git + cd vcpkg + git checkout 74e6536215718009aae747d86d84b78376bf9e09 + .\bootstrap-vcpkg.bat + echo "VCPKG_ROOT=${{ github.workspace }}\vcpkg" >> $env:GITHUB_ENV + - name: Create vcpkg.json - run: > - echo '{ "dependencies": [ "openssl", "botan", "cppunit" ], - "overrides": [ { "name": "openssl", "version-string": "1.1.1n" }, - { "name": "botan", "version-string": "2.19.3" } ], - "builtin-baseline": "38d1652f152d36481f2f4e8a85c0f1e14f3769f7" }' > vcpkg.json - - uses: seanmiddleditch/vcpkg-action@master - id: vcpkg - with: - manifest-dir: ${{ github.workspace }} - triplet: ${{ matrix.arch }}-windows - token: ${{ github.token }} - - name: Build run: | - mkdir build - cmake -B build ${{ steps.vcpkg.outputs.vcpkg-cmake-config }} -A ${{ matrix.target-platform }} -DWITH_CRYPTO_BACKEND=${{ matrix.backend }} ${{ matrix.build-options }} -DDISABLE_NON_PAGED_MEMORY=ON -DBUILD_TESTS=ON - cmake --build build + @' + { + "dependencies": [ "openssl", "botan", "cppunit" ], + "overrides": [ + { "name": "openssl", "version-string": "1.1.1n" }, + { "name": "botan", "version-string": "2.19.3" } + ], + "builtin-baseline": "74e6536215718009aae747d86d84b78376bf9e09" + } + '@ | Out-File -FilePath vcpkg.json -Encoding utf8 + + - name: Install dependencies + run: | + cd vcpkg + .\vcpkg.exe install --triplet=${{ matrix.vcpkg-triplet }} + working-directory: ${{ github.workspace }} + + - name: Configure + run: | + cmake -B build ` + -A ${{ matrix.target-platform }} ` + -DCMAKE_BUILD_TYPE=Release ` + -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake" ` + -DVCPKG_TARGET_TRIPLET=${{ matrix.vcpkg-triplet }} ` + -DWITH_CRYPTO_BACKEND=${{ matrix.backend }} ` + ${{ matrix.build-options }} ` + -DDISABLE_NON_PAGED_MEMORY=ON ` + -DBUILD_TESTS=ON + + - name: Build + run: cmake --build build --config Release + - name: Test env: CTEST_OUTPUT_ON_FAILURE: 1 - run: | - cmake --build build --target RUN_TESTS + run: cmake --build build --config Release --target RUN_TESTS