Skip to content

Commit af30a2d

Browse files
committed
Fix vcpkg build
1 parent 70c7d0f commit af30a2d

File tree

1 file changed

+45
-17
lines changed

1 file changed

+45
-17
lines changed

.github/workflows/ci.yml

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -113,39 +113,67 @@ jobs:
113113
- arch: x64
114114
backend: openssl
115115
target-platform: x64
116+
vcpkg-triplet: x64-windows
116117
build-options:
117118
- arch: x64
118119
backend: botan
119120
target-platform: x64
121+
vcpkg-triplet: x64-windows
120122
build-options: -DENABLE_ECC=OFF -DENABLE_EDDSA=OFF
121123
- arch: x86
122124
backend: openssl
123125
target-platform: Win32
126+
vcpkg-triplet: x86-windows
124127
build-options: -DENABLE_ECC=OFF -DENABLE_EDDSA=OFF
128+
env:
129+
VCPKG_DEFAULT_TRIPLET: ${{ matrix.vcpkg-triplet }}
125130
steps:
126131
- uses: actions/checkout@v4
132+
127133
- uses: ilammy/msvc-dev-cmd@v1
128134
with:
129135
arch: ${{ matrix.arch }}
136+
137+
- name: Setup vcpkg
138+
run: |
139+
git clone https://github.com/Microsoft/vcpkg.git
140+
cd vcpkg
141+
.\bootstrap-vcpkg.bat
142+
echo "VCPKG_ROOT=${{ github.workspace }}\vcpkg" >> $env:GITHUB_ENV
143+
130144
- name: Create vcpkg.json
131-
run: >
132-
echo '{ "dependencies": [ "openssl", "botan", "cppunit" ],
133-
"overrides": [ { "name": "openssl", "version-string": "1.1.1n" },
134-
{ "name": "botan", "version-string": "2.19.3" } ],
135-
"builtin-baseline": "38d1652f152d36481f2f4e8a85c0f1e14f3769f7" }' > vcpkg.json
136-
- uses: seanmiddleditch/vcpkg-action@master
137-
id: vcpkg
138-
with:
139-
manifest-dir: ${{ github.workspace }}
140-
triplet: ${{ matrix.arch }}-windows
141-
token: ${{ github.token }}
142-
- name: Build
143145
run: |
144-
mkdir build
145-
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
146-
cmake --build build
146+
@'
147+
{
148+
"dependencies": [ "openssl", "botan", "cppunit" ],
149+
"overrides": [
150+
{ "name": "openssl", "version": "1.1.1n" }
151+
]
152+
}
153+
'@ | Out-File -FilePath vcpkg.json -Encoding utf8
154+
155+
- name: Install dependencies
156+
run: |
157+
cd vcpkg
158+
.\vcpkg.exe install --triplet=${{ matrix.vcpkg-triplet }}
159+
working-directory: ${{ github.workspace }}
160+
161+
- name: Configure
162+
run: |
163+
cmake -B build `
164+
-A ${{ matrix.target-platform }} `
165+
-DCMAKE_BUILD_TYPE=Release `
166+
-DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake" `
167+
-DVCPKG_TARGET_TRIPLET=${{ matrix.vcpkg-triplet }} `
168+
-DWITH_CRYPTO_BACKEND=${{ matrix.backend }} `
169+
${{ matrix.build-options }} `
170+
-DDISABLE_NON_PAGED_MEMORY=ON `
171+
-DBUILD_TESTS=ON
172+
173+
- name: Build
174+
run: cmake --build build --config Release
175+
147176
- name: Test
148177
env:
149178
CTEST_OUTPUT_ON_FAILURE: 1
150-
run: |
151-
cmake --build build --target RUN_TESTS
179+
run: cmake --build build --config Release --target RUN_TESTS

0 commit comments

Comments
 (0)