summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-07-03 17:35:17 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-10-15 18:22:48 +0200
commitd6eebf53d98267885235d088722cc4b53b4166a3 (patch)
treeb4d7996e38f7f14131854f9544e6ea69fbfeddea
parent8bb4863ebd082b130c4282d49f3e1d2ead26855c (diff)
Clearer coverage compilation options configuration
Rename CCOV to COVERAGE to make it more clearer which compilation profile use and add a suffix to the built widget name except for the RELEASE built type which output the normal name. Change-Id: Ied0dfb47c25402c4146ebb190d65d17cff9ec360 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--cmake/cmake.d/01-build_options.cmake6
-rw-r--r--cmake/cmake.d/03-macros.cmake17
2 files changed, 12 insertions, 11 deletions
diff --git a/cmake/cmake.d/01-build_options.cmake b/cmake/cmake.d/01-build_options.cmake
index b90e0ce..1f7bd9c 100644
--- a/cmake/cmake.d/01-build_options.cmake
+++ b/cmake/cmake.d/01-build_options.cmake
@@ -57,7 +57,7 @@ endforeach()
##################################################
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 -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(COVERAGE_COMPILE_OPTIONS -g -O2 --coverage CACHE STRING "Compilation flags for COVERAGE 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($<$<CONFIG:PROFILING>:${option}>)
@@ -65,8 +65,8 @@ endforeach()
foreach(option ${DEBUG_COMPILE_OPTIONS})
add_compile_options($<$<CONFIG:DEBUG>:${option}>)
endforeach()
-foreach(option ${CCOV_COMPILE_OPTIONS})
- add_compile_options($<$<CONFIG:CCOV>:${option}>)
+foreach(option ${COVERAGE_COMPILE_OPTIONS})
+ add_compile_options($<$<CONFIG:COVERAGE>:${option}>)
endforeach()
foreach(option ${RELEASE_COMPILE_OPTIONS})
add_compile_options($<$<CONFIG:RELEASE>:${option}>)
diff --git a/cmake/cmake.d/03-macros.cmake b/cmake/cmake.d/03-macros.cmake
index 71f2964..710682c 100644
--- a/cmake/cmake.d/03-macros.cmake
+++ b/cmake/cmake.d/03-macros.cmake
@@ -440,6 +440,10 @@ macro(wgt_package_build)
set(WIDGET_ENTRY_POINT lib)
endif()
+ if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "RELEASE")
+ string(TOLOWER "${PROJECT_NAME}-${CMAKE_BUILD_TYPE}" WGT_NAME)
+ endif()
+
add_custom_command(OUTPUT ${PROJECT_PKG_BUILD_DIR}/config.xml
COMMAND ${CMAKE_COMMAND} -DINFILE=${WIDGET_CONFIG_TEMPLATE} -DOUTFILE=${PROJECT_PKG_BUILD_DIR}/config.xml -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake
COMMAND cp ${ICON_PATH} ${PROJECT_PKG_BUILD_DIR}/${PROJECT_ICON}
@@ -455,22 +459,19 @@ macro(wgt_package_build)
find_program(wgtpkgCMD "wgtpkg-pack")
if(wgtpkgCMD)
- message(STATUS "------ Create widget using WGTPKG")
- set(packCMD ${wgtpkgCMD} "-f" "-o" "${PROJECT_NAME}.wgt" ${PROJECT_PKG_BUILD_DIR})
+ set(packCMD ${wgtpkgCMD} "-f" "-o" "${WGT_NAME}.wgt" ${PROJECT_PKG_BUILD_DIR})
else()
- message(STATUS "----- Create widget using ZIP")
-
- set(packCMD cd ${PROJECT_PKG_BUILD_DIR} && ${CMAKE_COMMAND} "-E" "tar" "cf" "../${PROJECT_NAME}.wgt" "--format=zip" "*")
+ set(packCMD cd ${PROJECT_PKG_BUILD_DIR} && ${CMAKE_COMMAND} "-E" "tar" "cf" "../${WGT_NAME}.wgt" "--format=zip" "*")
endif()
- add_custom_command(OUTPUT ${PROJECT_NAME}.wgt
+ add_custom_command(OUTPUT ${WGT_NAME}.wgt
DEPENDS ${PROJECT_TARGETS}
COMMAND ${packCMD}
)
- add_custom_target(widget DEPENDS ${PROJECT_NAME}.wgt)
+ add_custom_target(widget DEPENDS ${WGT_NAME}.wgt)
add_dependencies(widget populate packaging_wgt)
- set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.wgt")
+ set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_CURRENT_BINARY_DIR}/${WGT_NAME}.wgt")
if(NOT RSYNC_TARGET)
message ("${Yellow}.. Warning: RSYNC_TARGET not defined 'make widget-target-install' not instanciated${ColourReset}")
redoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
FILESEXTRAPATHS:prepend := "${THISDIR}/linux:"

# Enable SMACK support without making it the default explicitly.
AGL_KCONFIG_FRAGMENTS += "smack.cfg"

# Enable SMACK as default LSM, can be overridden by changing this
# variable to e.g. "".
#
# NOTE:
# We use a different fragment for kernels older than 5.x that predate
# the switch to using CONFIG_LSM instead of CONFIG_DEFAULT_SECURITY.
# For simplicity, logic to handle the change being made in 5.1 instead
# of 5.0 has been omitted; in practice this should not be a problem
# since no current BSPs have been seen that use 5.0.x.  If a BSP
# kernel recipe does not set LINUX_VERSION, the kernel being 5.x or
# newer is assumed as the default behavior.
LINUX_VERSION_MAJOR = "${@(d.getVar('LINUX_VERSION') or "5.x").split('.')[0]}"
SMACK_DEFAULT_SUFFIX = "${@'' if int(d.getVar('LINUX_VERSION_MAJOR') or 0) >= 5 else '-old'}"
SMACK_DEFAULT_SECURITY ??= "smack-default-lsm${SMACK_DEFAULT_SUFFIX}.cfg"
AGL_KCONFIG_FRAGMENTS += "${SMACK_DEFAULT_SECURITY}"

# Enable audit support
AGL_KCONFIG_FRAGMENTS += "audit.cfg"