X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=cmake%2Fcmake.d%2F01-build_options.cmake;h=b90e0ced02aa3b28ca02d57007fd080b30cf926d;hb=aa68dbd12c60f9eb0015a508a22d8650914f8e5e;hp=b55df59326ac36a97adc39dbc249231baa7e5c22;hpb=e40a8546ddf015c03f93f06873b8975467bc1168;p=apps%2Fapp-templates.git diff --git a/cmake/cmake.d/01-build_options.cmake b/cmake/cmake.d/01-build_options.cmake index b55df59..b90e0ce 100644 --- a/cmake/cmake.d/01-build_options.cmake +++ b/cmake/cmake.d/01-build_options.cmake @@ -40,9 +40,6 @@ set(CMP0048 1) ############################################################################ link_libraries(-Wl,--as-needed -Wl,--gc-sections) set(COMPILE_OPTIONS -Wall -Wextra -Wconversion -Wno-unused-parameter -Wno-sign-compare -Wno-sign-conversion -Werror=maybe-uninitialized -Werror=implicit-function-declaration -ffunction-sections -fdata-sections -fPIC CACHE STRING "Compilation flags") -foreach(option ${COMPILE_OPTIONS}) - add_compile_options($<$:${option}>) -endforeach() # Compilation OPTIONS depending on language ######################################### @@ -59,20 +56,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