Codechange: Only apply FORTIFY_SOURCE in non-debug builds

It requires -O1 (or greater) and GCC spews out warnings if you try using it with -O0
pull/167/head
Charles Pigott 4 years ago
parent e5f931ef42
commit 887b912af1

@ -31,7 +31,7 @@ macro(compile_flags)
# it does not appear to support the $<> tags.
add_compile_options(
"$<$<CONFIG:Debug>:-D_DEBUG>"
"$<$<CONFIG:Debug>:-D_FORTIFY_SOURCE=2>"
"$<$<NOT:$<CONFIG:Debug>>:-D_FORTIFY_SOURCE=2>" # FORTIFY_SOURCE should only be used in non-debug builds (requires -O1+)
)
# Prepare a generator that checks if we are not a debug, and don't have asserts

Loading…
Cancel
Save