@@ -35,6 +35,9 @@ TOOLCHAIN_NATIVE ??= "${PREFERRED_TOOLCHAIN_NATIVE}"
inherit_defer toolchain/${TOOLCHAIN_NATIVE}-native
inherit_defer toolchain/${TOOLCHAIN}
+DEBUG_BUILD ??= "0"
+inherit_defer ${@oe.utils.vartrue('DEBUG_BUILD', 'debug_build', '', d)}
+
def lsb_distro_identifier(d):
adjust = d.getVar('LSB_DISTRO_ADJUST')
adjust_func = None
new file mode 100644
@@ -0,0 +1,8 @@
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+# Allow other layers to add their own debug build configurations
+include_all conf/distro/include/debug_build.inc
@@ -830,8 +830,6 @@ include conf/licenses.conf
require conf/sanity.conf
include conf/bblock.conf
-# Allow other layers to add their own debug build configurations
-include_all ${@oe.utils.vartrue('DEBUG_BUILD', 'conf/distro/include/debug_build.inc', '', d)}
##################################################################
# Weak variables (usually to retain backwards compatibility)
While setting DEBUG_BUILD = "1" in local.conf, the debug build is enabled globally. For the recipe (such as qemu) which doesn't work without optimization, we have to set DEBUG_BUILD = "0" in the recipe. In this situation, conf/distro/include/debug_build.inc is included, although set DEBUG_BUILD = "0" in qemu recipe, the debug build is still enabled for qemu and break qemu build. This commit defer inherit bblcass debug_build when DEBUG_BUILD is true, then include_all so that debug_build.inc is only included if DEBUG_BUILD is actually set for a given recip Suggested-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> --- meta/classes-global/base.bbclass | 3 +++ meta/classes-recipe/debug_build.bbclass | 8 ++++++++ meta/conf/bitbake.conf | 2 -- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 meta/classes-recipe/debug_build.bbclass