Skip to contentSkip to conversation

meson.bbclass: Make the default buildtype "debug" if DEBUG_BUILD is 1

PATCH New Peter Kjellerstedt 1 participant 1 message Aug 26, 2021 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 meson.bbclass: Make the default buildtype "debug" if DEBUG_BUILD is 1

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.

---
 meta/classes/meson.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/meson.bbclass +2 -1
index 2beed89d11..e124d18144 100644
@@ -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)} \