build: Disable fortify source in debug builds

This commit is contained in:
WerWolv
2025-02-23 20:24:10 +01:00
parent 6644df3958
commit 4c0e8bc1d6

View File

@@ -668,12 +668,15 @@ macro(setupCompilerFlags target)
addCXXFlag("-Wno-include-angled-in-module-purview" ${target})
# Enable hardening flags
addCommonFlag("-U_FORTIFY_SOURCE" ${target})
addCommonFlag("-D_FORTIFY_SOURCE=3" ${target})
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
addCommonFlag("-U_FORTIFY_SOURCE" ${target})
addCommonFlag("-D_FORTIFY_SOURCE=3" ${target})
if (NOT EMSCRIPTEN)
addCommonFlag("-fstack-protector-strong" ${target})
if (NOT EMSCRIPTEN)
addCommonFlag("-fstack-protector-strong" ${target})
endif()
endif()
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")