Skip to content

Commit a4675af

Browse files
committed
feature/cmake-vcpkg-toolchain: Create a default preset meant for release builds and provide template preset for local development
1 parent 0564033 commit a4675af

File tree

3 files changed

+55
-22
lines changed

3 files changed

+55
-22
lines changed

.github/workflows/build_and_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
run: chmod +x ./install_deps.sh && ./install_deps.sh
5858

5959
- name: Configure with Coverage
60-
run: cmake --preset release
60+
run: cmake --preset prod
6161

6262
- name: Build
6363
run: cmake --build --preset release

CMakePresets.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,41 @@
88
"cacheVariables": {
99
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
1010
}
11+
},
12+
{
13+
"name": "prod",
14+
"inherits": "vcpkg",
15+
"cacheVariables": {
16+
"CMAKE_C_COMPILER": "/usr/bin/cc",
17+
"CMAKE_CXX_COMPILER": "/usr/bin/c++",
18+
"CMAKE_BUILD_TYPE": "Release"
19+
},
20+
"environment": {
21+
"ENABLE_COVERAGE": "ON",
22+
"VCPKG_ROOT": "env{HOME}/vcpkg"
23+
}
24+
}
25+
],
26+
"buildPresets": [
27+
{
28+
"name": "release",
29+
"displayName": "Spark Release Build",
30+
"configurePreset": "prod"
31+
}
32+
],
33+
"testPresets": [
34+
{
35+
"name": "test_coverage",
36+
"displayName": "Spark Test Coverage",
37+
"configurePreset": "prod",
38+
"filter": {
39+
"exclude": {
40+
"name": "Databricks"
41+
}
42+
},
43+
"output": {
44+
"outputOnFailure": true
45+
}
1146
}
1247
]
1348
}

CMakeUserPresets.template.json

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,39 @@
22
"version": 2,
33
"configurePresets": [
44
{
5-
"name": "spark",
5+
"name": "dev",
66
"inherits": "vcpkg",
77
"cacheVariables": {
88
"CMAKE_C_COMPILER": "",
9-
"CMAKE_CXX_COMPILER": ""
9+
"CMAKE_CXX_COMPILER": "",
10+
"CMAKE_BUILD_TYPE": "Debug"
1011
},
1112
"environment": {
13+
"ENABLE_COVERAGE": "ON",
1214
"VCPKG_ROOT": ""
1315
}
14-
},
15-
{
16-
"name": "debug",
17-
"inherits": "spark",
18-
"cacheVariables": {
19-
"CMAKE_BUILD_TYPE": "Debug"
20-
}
21-
},
22-
{
23-
"name": "release",
24-
"inherits": "spark",
25-
"cacheVariables": {
26-
"CMAKE_BUILD_TYPE": "Release"
27-
}
2816
}
2917
],
3018
"buildPresets": [
3119
{
3220
"name": "debug",
3321
"displayName": "Spark Debug Build",
34-
"configurePreset": "debug"
35-
},
22+
"configurePreset": "dev"
23+
}
24+
],
25+
"testPresets": [
3626
{
37-
"name": "release",
38-
"displayName": "Spark Release Build",
39-
"configurePreset": "release"
27+
"name": "dev_coverage",
28+
"displayName": "Spark Local Test Coverage",
29+
"configurePreset": "dev",
30+
"filter": {
31+
"exclude": {
32+
"name": "Databricks"
33+
}
34+
},
35+
"output": {
36+
"outputOnFailure": true
37+
}
4038
}
4139
]
4240
}

0 commit comments

Comments
 (0)