From 9b17efeda53eb57b2f264d4b7078c92ba24c4cf0 Mon Sep 17 00:00:00 2001 From: Thierry Bultel Date: Mon, 11 Jun 2018 16:08:03 +0200 Subject: Added -D_FORTIFY_SOURCE=2 to CFLAGS Added this option, to match the given ones when building from yocto with bitbake. Also fixed the sample example, and some copy-paste issues on build targets (RELEASE/DEBUG/PROFILING/CCOV). Change-Id: I759305e54d427e6763f32b1a86207fe35add1b3f Signed-off-by: Thierry Bultel --- cmake/cmake.d/01-build_options.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cmake') diff --git a/cmake/cmake.d/01-build_options.cmake b/cmake/cmake.d/01-build_options.cmake index b55df59..17f1eab 100644 --- a/cmake/cmake.d/01-build_options.cmake +++ b/cmake/cmake.d/01-build_options.cmake @@ -59,20 +59,20 @@ endforeach() # Compilation option depending on CMAKE_BUILD_TYPE ################################################## set(PROFILING_COMPILE_OPTIONS -g -O0 -pg -Wp,-U_FORTIFY_SOURCE CACHE STRING "Compilation flags for PROFILING build type.") -set(DEBUG_COMPILE_OPTIONS -g -ggdb -Wp,-U_FORTIFY_SOURCE CACHE STRING "Compilation flags for DEBUG build type.") +set(DEBUG_COMPILE_OPTIONS -g -ggdb -D_FORTIFY_SOURCE=2 CACHE STRING "Compilation flags for DEBUG build type.") set(CCOV_COMPILE_OPTIONS -g -O2 --coverage CACHE STRING "Compilation flags for CCOV build type.") -set(RELEASE_COMPILE_OPTIONS -g -O2 CACHE STRING "Compilation flags for RELEASE build type.") +set(RELEASE_COMPILE_OPTIONS -g -O2 -D_FORTIFY_SOURCE=2 CACHE STRING "Compilation flags for RELEASE build type.") foreach(option ${PROFILING_COMPILE_OPTIONS}) add_compile_options($<$:${option}>) endforeach() foreach(option ${DEBUG_COMPILE_OPTIONS}) - add_compile_options($<$:${option}>) + add_compile_options($<$:${option}>) endforeach() foreach(option ${CCOV_COMPILE_OPTIONS}) - add_compile_options($<$:${option}>) + add_compile_options($<$:${option}>) endforeach() foreach(option ${RELEASE_COMPILE_OPTIONS}) - add_compile_options($<$:${option}>) + add_compile_options($<$:${option}>) endforeach() # Loop on required package and add options -- cgit 1.2.3-korg