summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2020-06-27 12:17:05 +0100
committerCharles Pigott <charlespigott@googlemail.com>2020-06-27 14:51:14 +0100
commit887b912af123b5a9bf2339a98e724afe99e6a03d (patch)
tree4544f8a3bc02d06537d714eae318a034222c2c29
parente5f931ef42ca169003d2282a8a585ea208b5f943 (diff)
downloadopenttd-887b912af123b5a9bf2339a98e724afe99e6a03d.tar.xz
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
-rw-r--r--cmake/CompileFlags.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmake/CompileFlags.cmake b/cmake/CompileFlags.cmake
index 05c19abab..9287ca249 100644
--- a/cmake/CompileFlags.cmake
+++ b/cmake/CompileFlags.cmake
@@ -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