Skip to content

Commit 77c05e3

Browse files
committed
Use upstream vcpkg instead of our own vcpkg fork
1 parent 1313e8a commit 77c05e3

File tree

10 files changed

+169
-383
lines changed

10 files changed

+169
-383
lines changed

.github/workflows/vcpkg-build.yml

Lines changed: 54 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -10,54 +10,58 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
cfg:
13-
- { os: ubuntu-latest, triplet: x64-linux }
14-
- { os: windows-latest, triplet: x64-windows-static-vs2022 }
15-
- { os: macos-latest, triplet: arm64-osx }
16-
- { os: macos-latest, triplet: x64-osx }
13+
- { os: ubuntu-latest }
14+
- { os: windows-latest }
15+
- { os: macos-latest }
16+
- { os: macos-latest }
1717

18-
steps:
19-
- name: install python
20-
uses: actions/setup-python@v5
21-
with:
22-
python-version: "3.x"
23-
- name: Clone repository
24-
uses: actions/checkout@v4
25-
with:
26-
submodules: true
27-
- name: Install linux dependencies
28-
if: ${{ runner.os == 'Linux' }}
29-
run: sudo apt-get install nasm openssl ninja-build autoconf-archive
30-
- name: Install osx dependencies
31-
if: ${{ runner.os == 'macOS' }}
32-
run: brew install nasm ninja automake autoconf autoconf-archive
33-
- name: Cache vcpkg binary
34-
id: cache-vcpkg-bin
35-
uses: actions/cache@v4
36-
with:
37-
path: |
38-
deps/vcpkg/vcpkg
39-
deps/vcpkg/vcpkg.exe
40-
key: ${{ runner.os }}-${{ hashFiles('deps/vcpkg/bootstrap.cmake') }}
41-
- name: Cache vcpkg packages
42-
id: cache-vcpkg
43-
uses: actions/cache@v4
44-
with:
45-
path: |
46-
~/.cache/vcpkg
47-
~/AppData/Local/vcpkg/archives
48-
key: ${{ runner.os }}-${{ matrix.cfg.triplet }}-${{ hashFiles('vcpkg.json', '.git/modules/deps/vcpkg/shallow') }}
49-
- name: Bootstrap the ports
50-
id: bootstrap
51-
run: python bootstrap.py --triplet ${{ matrix.cfg.triplet }} --clean-after-build
52-
- name: Build the code
53-
run: python build.py --triplet ${{ matrix.cfg.triplet }} --run-tests --cpp20
54-
- name: Archive build logs
55-
if: ${{ failure() && steps.bootstrap.conclusion == 'failure' }}
56-
uses: actions/upload-artifact@v4
57-
with:
58-
name: build-logs
59-
path: |
60-
deps/vcpkg/buildtrees/**/config*.log
61-
deps/vcpkg/buildtrees/**/build*.log
62-
deps/vcpkg/buildtrees/**/install*.log
63-
deps/vcpkg/buildtrees/**/package*.log
18+
env:
19+
VCPKG_TAG: 2025.01.13
20+
21+
steps:
22+
- name: Clone repository
23+
uses: actions/checkout@v4
24+
- name: Export GitHub Actions cache environment variables
25+
uses: actions/github-script@v7
26+
with:
27+
script: |
28+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
29+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
30+
- uses: seanmiddleditch/gha-setup-ninja@master
31+
- name: Install vcpkg
32+
run: |
33+
git clone --depth 1 --branch ${{ env.VCPKG_TAG }} https://github.com/microsoft/vcpkg "${{ runner.TEMP }}/vcpkg"
34+
- name: Bootstrap vcpkg windows
35+
if: ${{ runner.os == 'Windows' }}
36+
run: |
37+
${{ runner.TEMP }}/vcpkg/bootstrap-vcpkg.bat
38+
- name: Bootstrap vcpkg unix
39+
if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
40+
run: |
41+
sh ${{ runner.TEMP }}/vcpkg/bootstrap-vcpkg.sh
42+
- uses: taiki-e/install-action@v2
43+
with:
44+
tool: just
45+
- name: Install linux dependencies
46+
if: ${{ runner.os == 'Linux' }}
47+
run: sudo apt-get install nasm openssl
48+
- name: Install osx dependencies
49+
if: ${{ runner.os == 'macOS' }}
50+
run: |
51+
brew install nasm
52+
- name: Bootstrap the ports
53+
working-directory: ./cpp
54+
run: just bootstrap
55+
env:
56+
VCPKG_ROOT: "${{ runner.temp }}/vcpkg"
57+
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
58+
- name: Build the code
59+
env:
60+
VCPKG_ROOT: "${{ runner.temp }}/vcpkg"
61+
working-directory: ./cpp
62+
run: just build
63+
- name: Run the unit tests
64+
env:
65+
VCPKG_ROOT: "${{ runner.temp }}/vcpkg"
66+
working-directory: ./cpp
67+
run: just test

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "deps/vcpkg"]
2-
path = deps/vcpkg
3-
url = https://github.com/VITObelgium/vcpkg-ports.git

CMakeLists.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,9 @@ cmake_dependent_option(INFRA_UI_COMPONENTS_LOCATION "Location related qt ui comp
3232
string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}" INFRA_IS_TOPLEVEL)
3333

3434
if(INFRA_IS_TOPLEVEL)
35-
cmake_minimum_required(VERSION 3.21)
35+
cmake_minimum_required(VERSION 3.28)
3636

37-
if(NOT CMAKE_CXX_STANDARD)
38-
set(CMAKE_CXX_STANDARD 20)
39-
endif()
37+
set(CMAKE_CXX_STANDARD 20)
4038

4139
if(INFRA_ENABLE_TESTS)
4240
enable_testing()
@@ -55,7 +53,7 @@ if(INFRA_IS_TOPLEVEL)
5553
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
5654

5755
message(STATUS "Toplevel infra build C++${CMAKE_CXX_STANDARD}")
58-
set(CMAKE_REQUIRED_FLAGS ${CMAKE_CXX17_STANDARD_COMPILE_OPTION})
56+
set(CMAKE_REQUIRED_FLAGS ${CMAKE_CXX20_STANDARD_COMPILE_OPTION})
5957

6058
if(MSVC OR(WIN32 AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "IntelLLVM"))
6159
# avoid windows specific warnings

CMakePresets.json

Lines changed: 30 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,21 @@
11
{
2-
"version": 5,
3-
"cmakeMinimumRequired": {
4-
"major": 3,
5-
"minor": 21,
6-
"patch": 0
7-
},
8-
"include": [
9-
"deps/vcpkg/scripts/buildtools/CMakePresets.json"
10-
],
2+
"$schema": "https://cmake.org/cmake/help/latest/_downloads/3e2d73bff478d88a7de0de736ba5e361/schema.json",
3+
"version": 8,
114
"configurePresets": [
125
{
13-
"name": "multi",
14-
"generator": "Ninja Multi-Config",
15-
"hidden": true
6+
"name": "vcpkg",
7+
"cacheVariables": {
8+
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
9+
"VCPKG_MANIFEST_INSTALL": "OFF",
10+
"VCPKG_INSTALLED_DIR": "${sourceDir}/vcpkg_installed"
11+
}
1612
},
1713
{
18-
"name": "vcpkg-base",
19-
"inherits": "multi",
20-
"hidden": true,
21-
"binaryDir": "${sourceDir}/build/vcpkg",
14+
"name": "default",
15+
"binaryDir": "${sourceDir}/build",
16+
"inherits": "vcpkg",
17+
"generator": "Ninja Multi-Config",
2218
"cacheVariables": {
23-
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/deps/vcpkg/scripts/buildsystems/vcpkg.cmake",
24-
"VCPKG_APPLOCAL_DEPS": "OFF",
25-
"VCPKG_MANIFEST_MODE": "OFF",
2619
"INFRA_LOGGING": "ON",
2720
"INFRA_GDAL": "ON",
2821
"INFRA_XML": "ON",
@@ -41,140 +34,40 @@
4134
}
4235
},
4336
{
44-
"name": "msvc",
45-
"displayName": "MSVC x64",
46-
"description": "64bit MSVC build",
47-
"inherits": [
48-
"vcpkg-base",
49-
"triplet-x64-windows-static-vs2022"
50-
],
51-
"binaryDir": "${sourceDir}/build/vcpkg-msvc",
37+
"name": "mac-arm",
38+
"inherits": "default",
5239
"cacheVariables": {
53-
"VCPKG_INSTALLED_DIR": "${sourceDir}/vcpkgs-x64-windows-static-vs2022"
40+
"VCPKG_TARGET_TRIPLET": "arm64-osx"
5441
}
5542
},
5643
{
57-
"name": "msvc-asan",
58-
"displayName": "MSVC x64 ASAN",
59-
"description": "Vcpkg build for x64 on windows with address sanitizer (MSVC)",
60-
"inherits": [
61-
"vcpkg-base",
62-
"triplet-x64-windows-static-asan-vs2022"
63-
],
64-
"binaryDir": "${sourceDir}/build/vcpkg-msvc-asan",
44+
"name": "mac-intel",
45+
"inherits": "default",
6546
"cacheVariables": {
66-
"VCPKG_INSTALLED_DIR": "${sourceDir}/vcpkgs-x64-windows-static-asan-vs2022"
47+
"VCPKG_TARGET_TRIPLET": "x64-osx"
6748
}
6849
},
6950
{
70-
"name": "arm64-osx",
71-
"inherits": [
72-
"vcpkg-base",
73-
"triplet-arm64-osx"
74-
],
75-
"displayName": "Mac arm64",
76-
"description": "Vcpkg build for arm64 on macOS",
51+
"name": "windows",
52+
"inherits": "default",
53+
"generator": "Visual Studio 17 2022",
7754
"cacheVariables": {
78-
"VCPKG_INSTALLED_DIR": "${sourceDir}/vcpkgs-arm64-osx",
79-
"VCPKG_ALLOW_SYSTEM_LIBS": "ON"
55+
"VCPKG_TARGET_TRIPLET": "x64-windows-static",
56+
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded$<$<CONFIG:Debug>:Debug>"
8057
}
8158
},
8259
{
83-
"name": "x64-osx",
84-
"inherits": [
85-
"vcpkg-base",
86-
"triplet-x64-osx"
87-
],
88-
"displayName": "Mac x64",
89-
"description": "Vcpkg build for x64 on mac"
90-
},
91-
{
92-
"name": "arm64-linux",
93-
"inherits": [
94-
"vcpkg-base",
95-
"triplet-arm64-linux"
96-
],
97-
"displayName": "arm64 Linux Docker",
98-
"description": "Vcpkg build for arm64 on macOS",
60+
"name": "linux",
61+
"inherits": "default",
9962
"cacheVariables": {
100-
"VCPKG_INSTALLED_DIR": "/usr/vcpkgs-arm64-linux"
63+
"VCPKG_TARGET_TRIPLET": "x64-linux"
10164
}
102-
}
103-
],
104-
"buildPresets": [
105-
{
106-
"name": "Debug Win",
107-
"displayName": "Debug",
108-
"configurePreset": "msvc",
109-
"configuration": "Debug",
110-
"inherits": [
111-
"build-win-only"
112-
]
113-
},
114-
{
115-
"name": "Release Win",
116-
"displayName": "Release",
117-
"configurePreset": "msvc",
118-
"configuration": "Release",
119-
"inherits": [
120-
"build-win-only"
121-
]
12265
},
12366
{
124-
"name": "ASAN",
125-
"configurePreset": "msvc-asan",
126-
"configuration": "Debug",
127-
"inherits": [
128-
"build-win-only"
129-
]
130-
},
131-
{
132-
"name": "Debug arm OSX",
133-
"displayName": "Debug",
134-
"configurePreset": "arm64-osx",
135-
"configuration": "Debug",
136-
"inherits": [
137-
"build-mac-only"
138-
]
139-
},
140-
{
141-
"name": "Release arm OSX",
142-
"displayName": "Release",
143-
"configurePreset": "arm64-osx",
144-
"configuration": "Release",
145-
"inherits": [
146-
"build-mac-only"
147-
]
148-
},
149-
{
150-
"name": "Debug docker arm64",
151-
"displayName": "Debug",
152-
"configurePreset": "arm64-linux",
153-
"configuration": "Debug",
154-
"inherits": [
155-
"build-linux-only"
156-
]
157-
},
158-
{
159-
"name": "Release docker arm64",
160-
"displayName": "Release",
161-
"configurePreset": "arm64-linux",
162-
"configuration": "Release",
163-
"inherits": [
164-
"build-linux-only"
165-
]
166-
}
167-
],
168-
"testPresets": [
169-
{
170-
"name": "default",
171-
"configurePreset": "x64-windows-intel release",
172-
"output": {
173-
"outputOnFailure": true
174-
},
175-
"execution": {
176-
"noTestsAction": "error",
177-
"stopOnFailure": true
67+
"name": "mac-arm-local",
68+
"inherits": "mac-arm",
69+
"environment": {
70+
"VCPKG_ROOT": "${sourceDir}/../../vcpkg"
17871
}
17972
}
18073
]

0 commit comments

Comments
 (0)