From 887b912af123b5a9bf2339a98e724afe99e6a03d Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Sat, 27 Jun 2020 12:17:05 +0100 Subject: 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 --- cmake/CompileFlags.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmake') 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( "$<$:-D_DEBUG>" - "$<$:-D_FORTIFY_SOURCE=2>" + "$<$>:-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 -- cgit v1.2.3-54-g00ecf