build: Disable _FORTIFY_SOURCE on Debug builds. (#7348)

This commit is contained in:
Steveice10 2024-01-12 20:24:23 -08:00 committed by GitHub
parent da9f382d2c
commit 30c53c9509
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -110,12 +110,16 @@ else()
# In case a flag isn't supported on e.g. a certain architecture, don't error. # In case a flag isn't supported on e.g. a certain architecture, don't error.
-Wno-unused-command-line-argument -Wno-unused-command-line-argument
# Build fortification options # Build fortification options
-Wp,-D_FORTIFY_SOURCE=2
-Wp,-D_GLIBCXX_ASSERTIONS -Wp,-D_GLIBCXX_ASSERTIONS
-fstack-protector-strong -fstack-protector-strong
-fstack-clash-protection -fstack-clash-protection
) )
if (NOT CMAKE_BUILD_TYPE STREQUAL Debug)
# _FORTIFY_SOURCE can't be used without optimizations.
add_compile_options(-Wp,-D_FORTIFY_SOURCE=2)
endif()
if (CITRA_WARNINGS_AS_ERRORS) if (CITRA_WARNINGS_AS_ERRORS)
add_compile_options(-Werror) add_compile_options(-Werror)
endif() endif()