[yocto] CMake based recipes and defining CMAKE_BUILD_TYPE

Andreas Müller schnitzeltony at gmail.com
Wed Feb 6 13:31:26 PST 2019


On Wed, Feb 6, 2019 at 7:39 PM Matt Schuckmann
<Matt.Schuckmann at planar.com> wrote:
>
> I'm trying to understand why the cmake.bbclass doesn't make any attempt to set CMAKE_BUILD_TYPE and what the design philosophy behind that is?
>
> On the surface I would expect that the default build type would be Release but I can see how that might not always be the right choice. I'm really surprised that there isn't a global variable that can be set for this, am I missing something, or is it really expected that each recipe provide it if they care?
>
>
> FYI I started looking into this when I realized that NDEBUG is not set for many (if not all) of my CMake based recipes and thus asserts are still enabled in my production code. This appears to be known behavior for CMake if CMAKE_BUILD_TYPE is not set.
>
>
> Matt S.
>
Hi Matt,

This is not a full answer but Release is not a common target for us:
cmake will produce not containing debug info. With these debugging is
useless (and you'll get package qa warnings). If there is a default
target for us it is RelWithDebInfo.

Andreas


More information about the yocto mailing list