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=04c53c796baf5c93db194ca88ef03b5b11b82690;hpb=cd0660512276d935b7e5e6f5ebae538f64e16f3f;p=apps%2Fapp-templates.git diff --git a/cmake/cmake.d/01-build_options.cmake b/cmake/cmake.d/01-build_options.cmake index 04c53c7..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,33 +56,22 @@ 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() -# Env variable overload default -# Disabled by default now. Tell me if you need really it -# but you should not have needs for that since you can -# set CMAKE_INSTALL_PREFIX in your config.cmake. -#if(DEFINED ENV{INSTALL_PREFIX}) -# set(INSTALL_PREFIX $ENV{INSTALL_PREFIX} CACHE PATH "The path where to install") -#else() -# set(INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/Install" CACHE PATH "The path where to install") -#endif() -#set(CMAKE_INSTALL_PREFIX ${INSTALL_PREFIX} CACHE PATH "Installation Prefix") - # Loop on required package and add options foreach (PKG_CONFIG ${PKG_REQUIRED_LIST}) string(REGEX REPLACE "[<>]?=.*$" "" XPREFIX ${PKG_CONFIG}) @@ -110,7 +96,9 @@ ENDIF(CMAKE_BUILD_TYPE MATCHES DEBUG AND USE_EFENCE) INCLUDE_DIRECTORIES(${EXTRA_INCLUDE_DIRS}) # Default Linkflag -set (PKG_TEMPLATE_PREFIX ${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR} CACHE PATH "Default Package Templates Directory") +set(PKG_TEMPLATE_PREFIX "\"${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}\"" CACHE PATH "Default Package Templates Directory") +set(BARE_PKG_TEMPLATE_PREFIX "${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}" CACHE PATH "Default Package Templates Directory") + if(NOT BINDINGS_LINK_FLAG) set(BINDINGS_LINK_FLAG "-Wl,--version-script=${PKG_TEMPLATE_PREFIX}/cmake/export.map") endif()