[yocto] Relase or debug by PACKAGECONFIG or MY_APP_VAR?

Burton, Ross ross.burton at intel.com
Thu Dec 13 01:45:46 PST 2018


On Thu, 13 Dec 2018 at 08:20, Mauro Ziliani <mauro at faresoftware.it> wrote:
> To compile the app in release mode I need set
>
> EXTRA_OECMAKE + = " -DCMAKE_BUILD_TYPE=Release "
>
>
> while in debug mode I need to set
>
> EXTRA_OECMAKE + = " -DCMAKE_BUILD_TYPE=Debug "
>
>
> I defined 2 image recipes: one for production (Release) and one for
> testing (Debug)
>
> my-system.bb
>
> my-system-debug.bb

It doesn't matter if you use PACKAGECONFIG or a custom variable, what
you want isn't possible.  An image can't control how a dependent
recipe builds.

What are the implications of changing CMAKE_BUILD_TYPE?  If it's just
whether debug symbols are present or not then this isn't a problem:
just enable the IMAGE_FEATURE dbg-pkgs for the debug image.

If it does actual code changes, then you'll have to toggle that either
in the app recipe itself, or globally.  Arguably the cmake class
should have a variable to control CMAKE_BUILD_TYPE so it's trivial to
override.

Ross


More information about the yocto mailing list