Skip to content

Commit

Permalink
Fix _GLIBCXX_ASSERTIONS define in presets
Browse files Browse the repository at this point in the history
This definition was used in C projects for the C compiler flags as well,
but was missing from the CXX compiler flags for C projects.
  • Loading branch information
friendlyanon committed Mar 21, 2024
1 parent 73f553a commit 7718692
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmake-init/templates/common/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@
"description": "These flags are supported by both GCC and Clang",
"hidden": true,
"cacheVariables": {
"CMAKE_C{% if cpp %}XX{% end %}_FLAGS": "-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS=1 -fstack-protector-strong -fcf-protection=full -fstack-clash-protection -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wcast-qual -Wformat=2 -Wundef -Werror=float-equal -Wshadow -Wcast-align -Wunused -Wnull-dereference -Wdouble-promotion -Wimplicit-fallthrough {% if c %}-Werror=strict-prototypes -Wwrite-strings{% if c90 %} -Werror=declaration-after-statement{% end %}{% else %}-Wextra-semi -Woverloaded-virtual -Wnon-virtual-dtor -Wold-style-cast{% end %}",{% if c and pm %}
"CMAKE_CXX_FLAGS": "-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -fcf-protection=full -fstack-clash-protection -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wcast-qual -Wformat=2 -Wundef -Werror=float-equal -Wshadow -Wcast-align -Wunused -Wnull-dereference -Wdouble-promotion -Wimplicit-fallthrough -Wextra-semi -Woverloaded-virtual -Wnon-virtual-dtor -Wold-style-cast",{% end %}
"CMAKE_C{% if cpp %}XX{% end %}_FLAGS": "-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3{% if cpp %} -D_GLIBCXX_ASSERTIONS=1{% end %} -fstack-protector-strong -fcf-protection=full -fstack-clash-protection -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wcast-qual -Wformat=2 -Wundef -Werror=float-equal -Wshadow -Wcast-align -Wunused -Wnull-dereference -Wdouble-promotion -Wimplicit-fallthrough {% if c %}-Werror=strict-prototypes -Wwrite-strings{% if c90 %} -Werror=declaration-after-statement{% end %}{% else %}-Wextra-semi -Woverloaded-virtual -Wnon-virtual-dtor -Wold-style-cast{% end %}",{% if c and pm %}
"CMAKE_CXX_FLAGS": "-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS=1 -fstack-protector-strong -fcf-protection=full -fstack-clash-protection -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wcast-qual -Wformat=2 -Wundef -Werror=float-equal -Wshadow -Wcast-align -Wunused -Wnull-dereference -Wdouble-promotion -Wimplicit-fallthrough -Wextra-semi -Woverloaded-virtual -Wnon-virtual-dtor -Wold-style-cast",{% end %}
"CMAKE_EXE_LINKER_FLAGS": "-Wl,--allow-shlib-undefined,--as-needed,-z,noexecstack,-z,relro,-z,now,-z,nodlopen",
"CMAKE_SHARED_LINKER_FLAGS": "-Wl,--allow-shlib-undefined,--as-needed,-z,noexecstack,-z,relro,-z,now,-z,nodlopen"
}
Expand Down

0 comments on commit 7718692

Please sign in to comment.