]> code.ossystems Code Review - openembedded-core.git/commitdiff
meson.bbclass: Make the default buildtype "debug" if DEBUG_BUILD is 1
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>
Thu, 26 Aug 2021 12:59:12 +0000 (14:59 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 27 Aug 2021 10:53:23 +0000 (11:53 +0100)
Setting the Meson buildtype to "debug" will by default only enable the
-g option to the compiler, which should not matter for OE-Core as it is
already enabled by setting DEBUG_BUILD to 1 in the first place. However,
if the package uses get_option('debug') in its meson.build files to
enable package specific debug code, this will now trigger as intended.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/meson.bbclass

index 2beed89d11396a60bac8ddf1bf3460d49936136b..e124d18144d655fcbafb2272309e30b0246d3b30 100644 (file)
@@ -12,7 +12,8 @@ MESON_SOURCEPATH = "${S}"
 def noprefix(var, d):
     return d.getVar(var).replace(d.getVar('prefix') + '/', '', 1)
 
-MESON_BUILDTYPE ?= "plain"
+MESON_BUILDTYPE ?= "${@oe.utils.vartrue('DEBUG_BUILD', 'debug', 'plain', d)}"
+MESON_BUILDTYPE[vardeps] += "DEBUG_BUILD"
 MESONOPTS = " --prefix ${prefix} \
               --buildtype ${MESON_BUILDTYPE} \
               --bindir ${@noprefix('bindir', d)} \