Skip to content

Commit a126947

Browse files
committed
Refactor cmake presets: add debug, release; remove lto
1 parent c5ea9cc commit a126947

File tree

1 file changed

+127
-75
lines changed

1 file changed

+127
-75
lines changed

CMakePresets.json

Lines changed: 127 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"configurePresets": [
88
{
9-
"name": "base",
9+
"name": "conf-base",
1010
"hidden": true,
1111
"generator": "Ninja",
1212
"binaryDir": "${sourceDir}/build/${presetName}",
@@ -17,97 +17,137 @@
1717
"BUILD_DOCS": "ON",
1818
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
1919
},
20-
"description": "Common settings for all configurations"
20+
"description": "Shared settings for all configurations"
2121
},
2222
{
23-
"name": "gcc-RelWithDebInfo",
24-
"inherits": "base",
23+
"name": "conf-base-gcc",
24+
"hidden": true,
25+
"inherits": "conf-base",
2526
"cacheVariables": {
2627
"CMAKE_C_COMPILER": "gcc",
27-
"CMAKE_CXX_COMPILER": "g++",
28+
"CMAKE_CXX_COMPILER": "g++"
29+
},
30+
"description": "Base settings for GCC configurations"
31+
},
32+
{
33+
"name": "conf-base-clang",
34+
"hidden": true,
35+
"inherits": "conf-base",
36+
"cacheVariables": {
37+
"CMAKE_C_COMPILER": "clang",
38+
"CMAKE_CXX_COMPILER": "clang++"
39+
},
40+
"description": "Base settings for Clang configurations"
41+
},
42+
{
43+
"name": "gcc-Debug",
44+
"inherits": "conf-base-gcc",
45+
"cacheVariables": {
46+
"CMAKE_BUILD_TYPE": "Debug"
47+
},
48+
"description": "GCC Debug build"
49+
},
50+
{
51+
"name": "gcc-Release",
52+
"inherits": "conf-base-gcc",
53+
"cacheVariables": {
54+
"CMAKE_BUILD_TYPE": "Release"
55+
},
56+
"description": "GCC Release build"
57+
},
58+
{
59+
"name": "gcc-RelWithDebInfo",
60+
"inherits": "conf-base-gcc",
61+
"cacheVariables": {
2862
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
2963
},
30-
"description": "GCC build with RelWithDebInfo configuration"
64+
"description": "GCC RelWithDebInfo build"
3165
},
3266
{
3367
"name": "gcc-Sanitize",
34-
"inherits": "base",
68+
"inherits": "conf-base-gcc",
3569
"cacheVariables": {
36-
"CMAKE_C_COMPILER": "gcc",
37-
"CMAKE_CXX_COMPILER": "g++",
38-
"CMAKE_BUILD_TYPE": "Sanitize"
70+
"CMAKE_BUILD_TYPE": "Sanitize",
71+
"ENABLE_BENCHMARKS": "OFF",
72+
"BUILD_APP": "OFF"
3973
},
40-
"description": "GCC build with custom Sanitize configuration"
74+
"description": "GCC build with sanitizers"
4175
},
4276
{
43-
"name": "gcc-RelWithDebInfo-lto",
44-
"inherits": "gcc-RelWithDebInfo",
77+
"name": "gcc-Coverage",
78+
"inherits": "conf-base-gcc",
4579
"cacheVariables": {
46-
"CMAKE_C_COMPILER": "gcc",
47-
"CMAKE_CXX_COMPILER": "g++",
48-
"CMAKE_INTERPROCEDURAL_OPTIMIZATION": "TRUE"
80+
"CMAKE_BUILD_TYPE": "Coverage",
81+
"ENABLE_BENCHMARKS": "OFF",
82+
"BUILD_APP": "OFF"
4983
},
50-
"description": "GCC RelWithDebInfo build with Link Time Optimization (LTO)"
84+
"description": "GCC build for coverage analysis"
5185
},
5286
{
53-
"name": "gcc-Coverage",
54-
"inherits": "base",
87+
"name": "clang-Debug",
88+
"inherits": "conf-base-clang",
5589
"cacheVariables": {
56-
"CMAKE_C_COMPILER": "gcc",
57-
"CMAKE_CXX_COMPILER": "g++",
58-
"CMAKE_BUILD_TYPE": "Coverage"
90+
"CMAKE_BUILD_TYPE": "Debug"
5991
},
60-
"description": "GCC build with coverage"
92+
"description": "Clang Debug build"
6193
},
6294
{
63-
"name": "clang-RelWithDebInfo",
64-
"inherits": "base",
95+
"name": "clang-Release",
96+
"inherits": "conf-base-clang",
6597
"cacheVariables": {
66-
"CMAKE_C_COMPILER": "clang",
67-
"CMAKE_CXX_COMPILER": "clang++",
68-
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
98+
"CMAKE_BUILD_TYPE": "Release"
6999
},
70-
"description": "Clang build with RelWithDebInfo configuration"
100+
"description": "Clang Release build"
71101
},
72102
{
73-
"name": "clang-Sanitize",
74-
"inherits": "base",
103+
"name": "clang-RelWithDebInfo",
104+
"inherits": "conf-base-clang",
75105
"cacheVariables": {
76-
"CMAKE_C_COMPILER": "clang",
77-
"CMAKE_CXX_COMPILER": "clang++",
78-
"CMAKE_BUILD_TYPE": "Sanitize"
106+
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
79107
},
80-
"description": "Clang build with custom Sanitize configuration"
108+
"description": "Clang RelWithDebInfo build"
81109
},
82110
{
83-
"name": "clang-RelWithDebInfo-lto",
84-
"inherits": "clang-RelWithDebInfo",
111+
"name": "clang-Sanitize",
112+
"inherits": "conf-base-clang",
85113
"cacheVariables": {
86-
"CMAKE_C_COMPILER": "clang",
87-
"CMAKE_CXX_COMPILER": "clang++",
88-
"CMAKE_INTERPROCEDURAL_OPTIMIZATION": "TRUE"
114+
"CMAKE_BUILD_TYPE": "Sanitize",
115+
"ENABLE_BENCHMARKS": "OFF",
116+
"BUILD_APP": "OFF"
89117
},
90-
"description": "Clang RelWithDebInfo build with Link Time Optimization (LTO)"
118+
"description": "Clang build with sanitizers"
91119
},
92120
{
93121
"name": "clang-Coverage",
94-
"inherits": "base",
122+
"inherits": "conf-base-clang",
95123
"cacheVariables": {
96-
"CMAKE_C_COMPILER": "clang",
97-
"CMAKE_CXX_COMPILER": "clang++",
98-
"CMAKE_BUILD_TYPE": "Coverage"
124+
"CMAKE_BUILD_TYPE": "Coverage",
125+
"ENABLE_BENCHMARKS": "OFF",
126+
"BUILD_APP": "OFF"
99127
},
100-
"description": "Clang build with coverage"
128+
"description": "Clang build for coverage analysis"
101129
}
102130
],
103131
"buildPresets": [
104132
{
105133
"name": "build-base",
106134
"hidden": true,
107-
"description": "Shared build settings for all compilers",
108135
"jobs": 0,
109136
"verbose": false,
110-
"inheritConfigureEnvironment": true
137+
"inheritConfigureEnvironment": true,
138+
"description": "Shared build settings for all configurations"
139+
},
140+
{
141+
"name": "gcc-Debug",
142+
"inherits": "build-base",
143+
"configurePreset": "gcc-Debug",
144+
"description": "Build using gcc-Debug configuration"
145+
},
146+
{
147+
"name": "gcc-Release",
148+
"inherits": "build-base",
149+
"configurePreset": "gcc-Release",
150+
"description": "Build using gcc-Release configuration"
111151
},
112152
{
113153
"name": "gcc-RelWithDebInfo",
@@ -122,16 +162,22 @@
122162
"description": "Build using gcc-Sanitize configuration"
123163
},
124164
{
125-
"name": "gcc-RelWithDebInfo-lto",
165+
"name": "gcc-Coverage",
126166
"inherits": "build-base",
127-
"configurePreset": "gcc-RelWithDebInfo-lto",
128-
"description": "Build using GCC + LTO (RelWithDebInfo)"
167+
"configurePreset": "gcc-Coverage",
168+
"description": "Build using gcc-Coverage configuration"
129169
},
130170
{
131-
"name": "gcc-Coverage",
171+
"name": "clang-Debug",
132172
"inherits": "build-base",
133-
"configurePreset": "gcc-Coverage",
134-
"description": "Build using GCC + Coverage"
173+
"configurePreset": "clang-Debug",
174+
"description": "Build using clang-Debug configuration"
175+
},
176+
{
177+
"name": "clang-Release",
178+
"inherits": "build-base",
179+
"configurePreset": "clang-Release",
180+
"description": "Build using clang-Release configuration"
135181
},
136182
{
137183
"name": "clang-RelWithDebInfo",
@@ -145,24 +191,18 @@
145191
"configurePreset": "clang-Sanitize",
146192
"description": "Build using clang-Sanitize configuration"
147193
},
148-
{
149-
"name": "clang-RelWithDebInfo-lto",
150-
"inherits": "build-base",
151-
"configurePreset": "clang-RelWithDebInfo-lto",
152-
"description": "Build using Clang + LTO (RelWithDebInfo)"
153-
},
154194
{
155195
"name": "clang-Coverage",
156196
"inherits": "build-base",
157197
"configurePreset": "clang-Coverage",
158-
"description": "Build using Clang + Coverage"
198+
"description": "Build using clang-Coverage configuration"
159199
}
160200
],
161201
"testPresets": [
162202
{
163203
"name": "test-base",
164204
"hidden": true,
165-
"description": "Common test settings for all configurations",
205+
"description": "Shared test settings for all configurations",
166206
"output": {
167207
"outputOnFailure": true
168208
},
@@ -171,6 +211,18 @@
171211
"stopOnFailure": true
172212
}
173213
},
214+
{
215+
"name": "gcc-Debug",
216+
"inherits": "test-base",
217+
"configurePreset": "gcc-Debug",
218+
"description": "Test using gcc-Debug configuration"
219+
},
220+
{
221+
"name": "gcc-Release",
222+
"inherits": "test-base",
223+
"configurePreset": "gcc-Release",
224+
"description": "Test using gcc-Release configuration"
225+
},
174226
{
175227
"name": "gcc-RelWithDebInfo",
176228
"inherits": "test-base",
@@ -184,16 +236,22 @@
184236
"description": "Test using gcc-Sanitize configuration"
185237
},
186238
{
187-
"name": "gcc-RelWithDebInfo-lto",
239+
"name": "gcc-Coverage",
188240
"inherits": "test-base",
189-
"configurePreset": "gcc-RelWithDebInfo-lto",
190-
"description": "Test using GCC + LTO (RelWithDebInfo)"
241+
"configurePreset": "gcc-Coverage",
242+
"description": "Test using gcc-Coverage configuration"
191243
},
192244
{
193-
"name": "gcc-Coverage",
245+
"name": "clang-Debug",
194246
"inherits": "test-base",
195-
"configurePreset": "gcc-Coverage",
196-
"description": "Test using GCC + Coverage"
247+
"configurePreset": "clang-Debug",
248+
"description": "Test using clang-Debug configuration"
249+
},
250+
{
251+
"name": "clang-Release",
252+
"inherits": "test-base",
253+
"configurePreset": "clang-Release",
254+
"description": "Test using clang-Release configuration"
197255
},
198256
{
199257
"name": "clang-RelWithDebInfo",
@@ -207,17 +265,11 @@
207265
"configurePreset": "clang-Sanitize",
208266
"description": "Test using clang-Sanitize configuration"
209267
},
210-
{
211-
"name": "clang-RelWithDebInfo-lto",
212-
"inherits": "test-base",
213-
"configurePreset": "clang-RelWithDebInfo-lto",
214-
"description": "Test using Clang + LTO (RelWithDebInfo)"
215-
},
216268
{
217269
"name": "clang-Coverage",
218270
"inherits": "test-base",
219271
"configurePreset": "clang-Coverage",
220-
"description": "Test using Clang + Coverage"
272+
"description": "Test using clang-Coverage configuration"
221273
}
222274
]
223275
}

0 commit comments

Comments
 (0)