Skip to content

Commit 02e5481

Browse files
author
MarkusB
committed
Add EveryWarnClang and MaxWarnGcc presets in CMakePresets.json and update configurations to use them
1 parent 1379f2d commit 02e5481

1 file changed

Lines changed: 26 additions & 6 deletions

File tree

CMakePresets.json

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,24 @@
8282
"MB_DEVENV_ALL_WARNINGS": "ON"
8383
}
8484
},
85+
{
86+
"name": "EveryWarnClang",
87+
"hidden": true,
88+
"description": "MaxWarnClang plus the mb_devenv_set_target_warnings Clang/AppleClang ALL_WARNINGS branch (-Weverything and tuned -Wno*) via global CMAKE_CXX_FLAGS. MB_DEVENV_ALL_WARNINGS is OFF so mb_devenv_set_target_warnings does not add the same -Weverything set again per target. Same third-party / FetchContent caveats as MaxWarnClang.",
89+
"cacheVariables": {
90+
"CMAKE_CXX_FLAGS": "-D_GLIBCXX_ASSERTIONS -fexceptions -fno-builtin -fstack-clash-protection -fstack-protector-strong -U_FORTIFY_SOURCE -fno-delete-null-pointer-checks -fno-strict-overflow -fno-strict-aliasing -fno-limit-debug-info -fstrict-flex-arrays=3 -Wall -Wconversion -Werror -Wextra -Wformat -Wformat=2 -Wimplicit-fallthrough -Wno-deprecated-declarations -Wpedantic -Wsign-conversion -Wdocumentation -Wmissing-prototypes -Wno-c++11-narrowing -Wno-c++20-compat -Wno-switch-default -Wno-unused-command-line-argument -Wno-poison-system-directories -Weverything -Wmissing-prototypes -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-covered-switch-default -Wno-deprecated -Wno-double-promotion -Wno-exit-time-destructors -Wno-global-constructors -Wno-missing-noreturn -Wno-padded -Wno-redundant-parens -Wno-shadow-field-in-constructor -Wno-switch-enum -Wno-undef -Wno-undefined-reinterpret-cast -Wno-unused-member-function -Wno-weak-vtables",
91+
"MB_DEVENV_ALL_WARNINGS": "OFF"
92+
}
93+
},
94+
{
95+
"name": "MaxWarnGcc",
96+
"hidden": true,
97+
"description": "Duplicates mb_devenv_set_target_warnings GNU compile options via global CMAKE_CXX_FLAGS so they apply project-wide; this can break builds that pull in third-party sources (e.g. FetchContent) that do not compile cleanly under -Werror and the rest. Does not pass -D_FORTIFY_SOURCE=3 here (glibc requires -O; Debug would fail with -Werror); mb_devenv_set_target_warnings still sets it for Release-family configs. Flattens non-Debug-only -f flags and -ftrivial-auto-var-init=zero like MaxWarnClang. Adds -Wno-unused-command-line-argument for parity. MB_DEVENV_ALL_WARNINGS is OFF (GNU has no ALL_WARNINGS branch in the macro).",
98+
"cacheVariables": {
99+
"CMAKE_CXX_FLAGS": "-D_GLIBCXX_ASSERTIONS -fexceptions -fno-builtin -fstack-clash-protection -fstack-protector-strong -U_FORTIFY_SOURCE -fno-delete-null-pointer-checks -fno-strict-overflow -fno-strict-aliasing -fext-numeric-literals -fno-omit-frame-pointer -ftrivial-auto-var-init=zero -Wall -Wconversion -Werror -Wextra -Wformat -Wformat=2 -Wimplicit-fallthrough -Wno-deprecated-declarations -Wpedantic -Wsign-conversion -Wbidi-chars=any -Wno-comment -Wtrampolines -Wno-unused-command-line-argument",
100+
"MB_DEVENV_ALL_WARNINGS": "ON"
101+
}
102+
},
85103
{
86104
"name": "MaxSan",
87105
"hidden": true,
@@ -110,6 +128,7 @@
110128
"inherits": [
111129
"gcc",
112130
"debug",
131+
"MaxWarnGcc",
113132
"MaxSan",
114133
"base"
115134
]
@@ -121,6 +140,7 @@
121140
"inherits": [
122141
"gcc",
123142
"release",
143+
"MaxWarnGcc",
124144
"base"
125145
]
126146
},
@@ -131,7 +151,7 @@
131151
"inherits": [
132152
"clang",
133153
"debug",
134-
"MaxWarnClang",
154+
"EveryWarnClang",
135155
"MaxSan",
136156
"base"
137157
]
@@ -143,7 +163,7 @@
143163
"inherits": [
144164
"clang",
145165
"release",
146-
"MaxWarnClang",
166+
"EveryWarnClang",
147167
"base"
148168
]
149169
},
@@ -154,7 +174,7 @@
154174
"inherits": [
155175
"clang-libc++",
156176
"debug",
157-
"MaxWarnClang",
177+
"EveryWarnClang",
158178
"MaxSan",
159179
"base"
160180
]
@@ -166,7 +186,7 @@
166186
"inherits": [
167187
"clang-libc++",
168188
"release",
169-
"MaxWarnClang",
189+
"EveryWarnClang",
170190
"base"
171191
]
172192
},
@@ -177,7 +197,7 @@
177197
"inherits": [
178198
"appleclang",
179199
"debug",
180-
"MaxWarnClang",
200+
"EveryWarnClang",
181201
"MaxSan",
182202
"base"
183203
]
@@ -189,7 +209,7 @@
189209
"inherits": [
190210
"appleclang",
191211
"release",
192-
"MaxWarnClang",
212+
"EveryWarnClang",
193213
"base"
194214
]
195215
},

0 commit comments

Comments
 (0)