diff options
author | Charles Pigott <charlespigott@googlemail.com> | 2020-06-27 12:17:05 +0100 |
---|---|---|
committer | Charles Pigott <charlespigott@googlemail.com> | 2020-06-27 14:51:14 +0100 |
commit | 887b912af123b5a9bf2339a98e724afe99e6a03d (patch) | |
tree | 4544f8a3bc02d06537d714eae318a034222c2c29 | |
parent | e5f931ef42ca169003d2282a8a585ea208b5f943 (diff) | |
download | openttd-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.cmake | 2 |
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 |