mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 22:28:56 +00:00
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
This commit is contained in:
parent
e5f931ef42
commit
887b912af1
@ -31,7 +31,7 @@ macro(compile_flags)
|
|||||||
# it does not appear to support the $<> tags.
|
# it does not appear to support the $<> tags.
|
||||||
add_compile_options(
|
add_compile_options(
|
||||||
"$<$<CONFIG:Debug>:-D_DEBUG>"
|
"$<$<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
|
# Prepare a generator that checks if we are not a debug, and don't have asserts
|
||||||
|
Loading…
Reference in New Issue
Block a user