Default compile options for development
Description
Environment
Activity
Walt Miner August 28, 2018 at 4:38 PM
Closed for FF RC4

Romain Forlot August 28, 2018 at 12:26 PM
The 4 types has been implemented and the default compile options redefined to have a real debug compilation which doesn't optimize anything and a release build type set as default and with similar compilation options than a Yocto build

Romain Forlot August 16, 2018 at 8:30 AM
: Yep, about now it isn't the case. This is planned to make it but include gcno files isn't enough, it also must change the prefix where the gcda files will be generated. No big deal here but not done at this moment. Could you open a new JIRA ticket about that and assign it to me ? Thanks

Matt Ranostay August 15, 2018 at 3:38 AM
CMAKE_BUILD_TYPE=COVERAGE generates the respective .gcno files for gcov but doesn't actually put them in the wgt package.

Romain Forlot August 9, 2018 at 11:53 AM(edited)
I made a proposal in the gerrit review 16087 to set default compilation to the ones used by Yocto.
This changes the default build type to RELEASE as it would be built using Yocto. Debug builds should be activated if needed temporary as the other type: coverage and profiling. Doing this you are able to detect compilation error that would happens when building with Yocto and if you need to debug your program you only need to recompile changing temporary the build type to DEBUG.
So for the project not using the latest app-templates which defaulted to DEBUG before that, we should may be override the CMake invocation in Yocto by setting up the variable EXTRA_OECMAKE with "-DCMAKE_BUILD_TYPE=RELEASE" then we ensure that RELEASE is used and that will not generate test widget etc.
Also to be able to include test package we need a mechanism to set the build for testing purpose or not which should redefine the build type to DEBUG and will include ptest as well the needed test tool like afb-test binding etc.
Also should we have a dedicated image to build for the test ? This will include the tests packages by setting the DISTRO_FEATURES and EXTRA_IMAGE_FEATURES in the build configuration file by an AGL feature, "agl-test" for example.
Setting "inherit ptest" for all our recipes which have test included doesn't imply that Yocto will output test packages, you must have DISTRO_FEATURES and EXTRA_IMAGES_FEATURES set. So without positioning the "agl-test" feature we will produce a classic image like we already do. Once activated "agl-test" feature we would have an image with test packages included.
Test packages will be a test widget including all necessary resources to execute test + a script run-ptest which will launch the test.
Doing this way, we only need to add an AGL feature to enable test feature. Then the feature will set the CMAKE_BUILD_TYPE to DEBUG else if using a non-test build then it should set it at RELEASE. The CMake setting annoys me but I don't see another way at this moment.
Details
Details
Assignee

Reporter

I have a question about the default compilation options to set when building a binding or an app for the application framework. It is about app-templates submodules which has some default compilations set for 4 types of build : debug, profiling, coverage and release.
I think those 4 types are fine but the options to set up for each of them isn't clear because Yocto define its options, thus I assume that we should use the same compilation options. Then we are able to detect compilation error before the integration in the Yocto build.
As Yocto could changes its default options we need to follow its changes but for old build which use old options then we broke it because it uses the latest options instead of the old ones.
I wonder how to correctly manage the compilation options for app-templates, and for others which doesn't use it too.