Skip to content
This repository was archived by the owner on Apr 19, 2023. It is now read-only.

Commit bbd27d9

Browse files
Iason NikolasIason Nikolas
authored andcommitted
Add MinSizeRel preset (+8 squashed commit)
Squashed commit: [c64694d] Rename the linux presets to unixlike [0a57a97] Add binaryDir and installDir to be used in case of cli [ad5a3e7] Move mode options to CMakeUserPresets.json file [1c0fa00] Make hidden preset for each supported compiler/toolchain and reuse them in not hidden presets using "inherits" list. This way we the future changes will be applied only to the preset that is responsible for that functionality. [607a69f] Set "Ninja Multi-Config" generator as the default. Add buildPresets for Debug and Release. Modify testPresets accordingly [a98c295] Create separate developer and user mode hidden presets and use inherits to compose them to the non-hidden presets [e26f74c] replace conf- with config- in preset names [802e988] Let the IDE to set the default binary and install directories
1 parent c77d33f commit bbd27d9

File tree

2 files changed

+274
-133
lines changed

2 files changed

+274
-133
lines changed

CMakePresets.json

Lines changed: 168 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
},
88
"configurePresets": [
99
{
10-
"name": "conf-common",
10+
"name": "config-common",
1111
"description": "General settings that apply to all configurations",
1212
"hidden": true,
13-
"generator": "Ninja",
13+
"generator": "Ninja Multi-Config",
1414
"binaryDir": "${sourceDir}/out/build/${presetName}",
1515
"installDir": "${sourceDir}/out/install/${presetName}"
1616
},
1717
{
18-
"name": "conf-windows-common",
18+
"name": "config-windows-common",
1919
"description": "Windows settings for MSBuild toolchain that apply to msvc and clang",
2020
"hidden": true,
21-
"inherits": "conf-common",
21+
"inherits": "config-common",
2222
"condition": {
2323
"type": "equals",
2424
"lhs": "${hostSystemName}",
@@ -38,10 +38,10 @@
3838
}
3939
},
4040
{
41-
"name": "conf-unixlike-common",
41+
"name": "config-unixlike-common",
4242
"description": "Unix-like OS settings for gcc and clang toolchains",
4343
"hidden": true,
44-
"inherits": "conf-common",
44+
"inherits": "config-common",
4545
"condition": {
4646
"type": "inList",
4747
"string": "${hostSystemName}",
@@ -57,62 +57,21 @@
5757
}
5858
},
5959
{
60-
"name": "windows-msvc-debug-developer-mode",
61-
"displayName": "msvc Debug (Developer Mode)",
62-
"description": "Target Windows with the msvc compiler, debug build type",
63-
"inherits": "conf-windows-common",
64-
"cacheVariables": {
65-
"CMAKE_C_COMPILER": "cl",
66-
"CMAKE_CXX_COMPILER": "cl",
67-
"CMAKE_BUILD_TYPE": "Debug",
68-
"ENABLE_DEVELOPER_MODE": "ON"
69-
}
70-
},
71-
{
72-
"name": "windows-msvc-release-developer-mode",
73-
"displayName": "msvc Release (Developer Mode)",
74-
"description": "Target Windows with the msvc compiler, release build type",
75-
"inherits": "conf-windows-common",
76-
"cacheVariables": {
77-
"CMAKE_C_COMPILER": "cl",
78-
"CMAKE_CXX_COMPILER": "cl",
79-
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
80-
"ENABLE_DEVELOPER_MODE": "ON"
81-
}
82-
},
83-
{
84-
"name": "windows-msvc-debug-user-mode",
85-
"displayName": "msvc Debug (User Mode)",
86-
"description": "Target Windows with the msvc compiler, debug build type",
87-
"inherits": "conf-windows-common",
88-
"cacheVariables": {
89-
"CMAKE_C_COMPILER": "cl",
90-
"CMAKE_CXX_COMPILER": "cl",
91-
"CMAKE_BUILD_TYPE": "Debug",
92-
"ENABLE_DEVELOPER_MODE": "OFF"
93-
}
94-
},
95-
{
96-
"name": "windows-msvc-release-user-mode",
97-
"displayName": "msvc Release (User Mode)",
98-
"description": "Target Windows with the msvc compiler, release build type",
99-
"inherits": "conf-windows-common",
60+
"name": "config-msvc-compiler",
61+
"description": "Set cl as the compiler to be used",
62+
"hidden": true,
10063
"cacheVariables": {
10164
"CMAKE_C_COMPILER": "cl",
102-
"CMAKE_CXX_COMPILER": "cl",
103-
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
104-
"ENABLE_DEVELOPER_MODE": "OFF"
65+
"CMAKE_CXX_COMPILER": "cl"
10566
}
10667
},
10768
{
108-
"name": "windows-clang-debug",
109-
"displayName": "clang Debug",
110-
"description": "Target Windows with the clang compiler, debug build type",
111-
"inherits": "conf-windows-common",
69+
"name": "config-clangcl-compiler",
70+
"description": "Set clang-cl as the compiler to be used",
71+
"hidden": true,
11272
"cacheVariables": {
11373
"CMAKE_C_COMPILER": "clang-cl",
114-
"CMAKE_CXX_COMPILER": "clang-cl",
115-
"CMAKE_BUILD_TYPE": "Debug"
74+
"CMAKE_CXX_COMPILER": "clang-cl"
11675
},
11776
"vendor": {
11877
"microsoft.com/VisualStudioSettings/CMake/1.0": {
@@ -121,64 +80,126 @@
12180
}
12281
},
12382
{
124-
"name": "windows-clang-release",
125-
"displayName": "clang Release",
126-
"description": "Target Windows with the clang compiler, release build type",
127-
"inherits": "conf-windows-common",
83+
"name": "config-gcc-compiler",
84+
"description": "Set gcc as the compiler to be used",
85+
"hidden": true,
12886
"cacheVariables": {
129-
"CMAKE_C_COMPILER": "clang-cl",
130-
"CMAKE_CXX_COMPILER": "clang-cl",
131-
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
132-
},
133-
"vendor": {
134-
"microsoft.com/VisualStudioSettings/CMake/1.0": {
135-
"intelliSenseMode": "windows-clang-x64"
136-
}
87+
"CMAKE_C_COMPILER": "gcc",
88+
"CMAKE_CXX_COMPILER": "g++"
13789
}
13890
},
13991
{
140-
"name": "unixlike-gcc-debug",
141-
"displayName": "gcc Debug",
142-
"description": "Target Unix-like OS with the gcc compiler, debug build type",
143-
"inherits": "conf-unixlike-common",
92+
"name": "config-clang-compiler",
93+
"description": "Set clang as the compiler to be used",
94+
"hidden": true,
14495
"cacheVariables": {
145-
"CMAKE_C_COMPILER": "gcc",
146-
"CMAKE_CXX_COMPILER": "g++",
147-
"CMAKE_BUILD_TYPE": "Debug"
96+
"CMAKE_C_COMPILER": "clang",
97+
"CMAKE_CXX_COMPILER": "clang++"
14898
}
14999
},
150100
{
151-
"name": "unixlike-gcc-release",
152-
"displayName": "gcc Release",
153-
"description": "Target Unix-like OS with the gcc compiler, release build type",
154-
"inherits": "conf-unixlike-common",
155-
"cacheVariables": {
156-
"CMAKE_C_COMPILER": "gcc",
157-
"CMAKE_CXX_COMPILER": "g++",
158-
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
159-
}
101+
"name": "windows-msvc",
102+
"displayName": "msvc",
103+
"description": "Target Windows with the msvc compiler",
104+
"inherits": [
105+
"config-windows-common",
106+
"config-msvc-compiler"
107+
]
160108
},
161109
{
162-
"name": "unixlike-clang-debug",
163-
"displayName": "clang Debug",
164-
"description": "Target Unix-like OS with the clang compiler, debug build type",
165-
"inherits": "conf-unixlike-common",
166-
"cacheVariables": {
167-
"CMAKE_C_COMPILER": "clang",
168-
"CMAKE_CXX_COMPILER": "clang++",
169-
"CMAKE_BUILD_TYPE": "Debug"
170-
}
110+
"name": "windows-clang",
111+
"displayName": "clang",
112+
"description": "Target Windows with the clang compiler",
113+
"inherits": [
114+
"config-windows-common",
115+
"config-clangcl-compiler"
116+
]
171117
},
172118
{
173-
"name": "unixlike-clang-release",
174-
"displayName": "clang Release",
175-
"description": "Target Unix-like OS with the clang compiler, release build type",
176-
"inherits": "conf-unixlike-common",
177-
"cacheVariables": {
178-
"CMAKE_C_COMPILER": "clang",
179-
"CMAKE_CXX_COMPILER": "clang++",
180-
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
181-
}
119+
"name": "unixlike-gcc",
120+
"displayName": "gcc",
121+
"description": "Target unix-like OS with the gcc compiler",
122+
"inherits": [
123+
"config-unixlike-common",
124+
"config-gcc-compiler"
125+
]
126+
},
127+
{
128+
"name": "unixlike-clang",
129+
"displayName": "clang",
130+
"description": "Target Unix-like OS with the clang compiler",
131+
"inherits": [
132+
"config-unixlike-common",
133+
"config-clang-compiler"
134+
]
135+
}
136+
],
137+
"buildPresets": [
138+
{
139+
"name": "build-common-debug",
140+
"description": "Set build type to Debug",
141+
"hidden": true,
142+
"configuration": "Debug"
143+
},
144+
{
145+
"name": "build-common-release",
146+
"description": "Set build type to Release",
147+
"hidden": true,
148+
"configuration": "Release"
149+
},
150+
{
151+
"name": "build-common-relwithdebinfo",
152+
"description": "Set build type to Release",
153+
"hidden": true,
154+
"configuration": "RelWithDebInfo"
155+
},
156+
{
157+
"name": "build-common-minsizerel",
158+
"description": "Set build type to MinSizeRel",
159+
"hidden": true,
160+
"configuration": "MinSizeRel"
161+
},
162+
{
163+
"name": "windows-msvc-debug",
164+
"displayName": "Debug",
165+
"description": "Build msvc debug on windows",
166+
"inherits": "build-common-debug",
167+
"configurePreset": "windows-msvc"
168+
},
169+
{
170+
"name": "build-windows-msvc-release",
171+
"displayName": "Release",
172+
"description": "Build msvc release on windows",
173+
"inherits": "build-common-release",
174+
"configurePreset": "windows-msvc"
175+
},
176+
{
177+
"name": "build-unixlike-gcc-debug",
178+
"displayName": "Debug",
179+
"description": "Build gcc debug on unixlike OS",
180+
"inherits": "build-common-debug",
181+
"configurePreset": "unixlike-gcc"
182+
},
183+
{
184+
"name": "build-unixlike-gcc-release",
185+
"displayName": "Release",
186+
"description": "Build gcc release on unixlike OS",
187+
"inherits": "build-common-release",
188+
"configurePreset": "unixlike-gcc"
189+
},
190+
{
191+
"name": "build-unixlike-clang-debug",
192+
"displayName": "Debug",
193+
"description": "Build clang debug on unixlike OS",
194+
"inherits": "build-common-debug",
195+
"configurePreset": "unixlike-clang"
196+
},
197+
{
198+
"name": "build-unixlike-clang-release",
199+
"displayName": "Release",
200+
"description": "Build clang release on unixlike OS",
201+
"inherits": "build-common-release",
202+
"configurePreset": "unixlike-clang"
182203
}
183204
],
184205
"testPresets": [
@@ -195,60 +216,74 @@
195216
}
196217
},
197218
{
198-
"name": "test-windows-msvc-debug-developer-mode",
199-
"displayName": "Strict",
200-
"description": "Enable output and stop on failure",
219+
"name": "test-common-debug",
220+
"description": "Test CMake settings that apply to debug configurations",
221+
"hidden": true,
201222
"inherits": "test-common",
202-
"configurePreset": "windows-msvc-debug-developer-mode"
223+
"configuration": "Debug"
203224
},
204225
{
205-
"name": "test-windows-msvc-release-developer-mode",
206-
"displayName": "Strict",
207-
"description": "Enable output and stop on failure",
226+
"name": "test-common-release",
227+
"description": "Test CMake settings that apply to release configurations",
228+
"hidden": true,
208229
"inherits": "test-common",
209-
"configurePreset": "windows-msvc-release-developer-mode"
230+
"configuration": "Release"
231+
},
232+
{
233+
"name": "test-windows-msvc-debug",
234+
"displayName": "Debug",
235+
"description": "Set Strict rules for windows msvc debug tests",
236+
"inherits": "test-common-debug",
237+
"configurePreset": "windows-msvc"
238+
},
239+
{
240+
"name": "test-windows-msvc-release",
241+
"displayName": "Release",
242+
"description": "Set Strict rules for windows msvc release tests",
243+
"inherits": "test-common-release",
244+
"configurePreset": "windows-msvc"
210245
},
211246
{
212247
"name": "test-windows-clang-debug",
213-
"displayName": "Strict",
214-
"description": "Enable output and stop on failure",
215-
"inherits": "test-common",
216-
"configurePreset": "windows-clang-debug"
248+
"displayName": "Debug",
249+
"description": "Set Strict rules for windows clang debug tests",
250+
"inherits": "test-common-debug",
251+
"configurePreset": "windows-clang"
217252
},
218253
{
219254
"name": "test-windows-clang-release",
220-
"displayName": "Strict",
221-
"description": "Enable output and stop on failure",
222-
"inherits": "test-common",
223-
"configurePreset": "windows-clang-release"
255+
"displayName": "Release",
256+
"description": "Set Strict rules for windows clang release tests",
257+
"inherits": "test-common-release",
258+
"configurePreset": "windows-clang"
224259
},
225260
{
226261
"name": "test-unixlike-gcc-debug",
227-
"displayName": "Strict",
228-
"description": "Enable output and stop on failure",
229-
"inherits": "test-common",
230-
"configurePreset": "unixlike-gcc-debug"
262+
"displayName": "Debug",
263+
"description": "Set Strict rules for unixlike gcc debug tests",
264+
"inherits": "test-common-debug",
265+
"configurePreset": "unixlike-gcc"
231266
},
232267
{
233268
"name": "test-unixlike-gcc-release",
234-
"displayName": "Strict",
235-
"description": "Enable output and stop on failure",
236-
"inherits": "test-common",
237-
"configurePreset": "unixlike-gcc-release"
269+
"displayName": "Release",
270+
"description": "Set Strict rules for unixlike gcc release tests",
271+
"inherits": "test-common-release",
272+
"configurePreset": "unixlike-gcc"
238273
},
239274
{
240275
"name": "test-unixlike-clang-debug",
241-
"displayName": "Strict",
242-
"description": "Enable output and stop on failure",
243-
"inherits": "test-common",
244-
"configurePreset": "unixlike-clang-debug"
276+
"displayName": "Debug",
277+
"description": "Set Strict rules for unixlike clang debug tests",
278+
"inherits": "test-common-debug",
279+
"configurePreset": "unixlike-clang"
245280
},
246281
{
247282
"name": "test-unixlike-clang-release",
248-
"displayName": "Strict",
249-
"description": "Enable output and stop on failure",
250-
"inherits": "test-common",
251-
"configurePreset": "unixlike-clang-release"
283+
"displayName": "Release",
284+
"description": "Set Strict rules for unixlike clang release tests",
285+
"inherits": "test-common-release",
286+
"configurePreset": "unixlike-clang"
252287
}
253288
]
254289
}

0 commit comments

Comments
 (0)