diff mbox series

[v5,4/5] debug_build.inc: override MESON_BUILDTYPE for meson.bbclass

Message ID 20251010075258.2161972-4-hongxu.jia@windriver.com
State New
Headers show
Series [v5,1/5] distro/include: Add debug_build.inc when DEBUG_BUILD is enabled | expand

Commit Message

Hongxu Jia Oct. 10, 2025, 7:52 a.m. UTC
The debug_build.inc is used to collect debug build configuration,
override MESON_BUILDTYPE for meson.bbclass when DEBUG_BUILD is enabled

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/classes-recipe/meson.bbclass        | 3 +--
 meta/conf/distro/include/debug_build.inc | 3 +++
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

Richard Purdie Dec. 15, 2025, 12:02 p.m. UTC | #1
On Fri, 2025-10-10 at 15:52 +0800, hongxu via lists.openembedded.org
wrote:
> The debug_build.inc is used to collect debug build configuration,
> override MESON_BUILDTYPE for meson.bbclass when DEBUG_BUILD is
> enabled
> 
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
>  meta/classes-recipe/meson.bbclass        | 3 +--
>  meta/conf/distro/include/debug_build.inc | 3 +++
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/classes-recipe/meson.bbclass b/meta/classes-
> recipe/meson.bbclass
> index c8b3e1ec29..0944ea03cc 100644
> --- a/meta/classes-recipe/meson.bbclass
> +++ b/meta/classes-recipe/meson.bbclass
> @@ -28,8 +28,7 @@ MESON_INSTALL_TAGS ?= ""
>  def noprefix(var, d):
>      return d.getVar(var).replace(d.getVar('prefix') + '/', '', 1)
>  
> -MESON_BUILDTYPE ?= "${@oe.utils.vartrue('DEBUG_BUILD', 'debug',
> 'plain', d)}"
> -MESON_BUILDTYPE[vardeps] += "DEBUG_BUILD"
> +MESON_BUILDTYPE ??= "plain"
>  MESONOPTS = " --prefix ${prefix} \
>                --buildtype ${MESON_BUILDTYPE} \
>                --bindir ${@noprefix('bindir', d)} \
> diff --git a/meta/conf/distro/include/debug_build.inc
> b/meta/conf/distro/include/debug_build.inc
> index 1062326417..c8e2cf90cf 100644
> --- a/meta/conf/distro/include/debug_build.inc
> +++ b/meta/conf/distro/include/debug_build.inc
> @@ -44,3 +44,6 @@ CXXFLAGS:append:pn-vulkan-validation-layers = " -
> DXXH_NO_INLINE_HINTS=1"
>  # No strip sysroot for cross and native
>  INHIBIT_SYSROOT_STRIP:class-cross ?= "1"
>  INHIBIT_SYSROOT_STRIP:class-native ?= "1"
> +
> +# For meson.bbclass
> +MESON_BUILDTYPE ?= "debug"

Should we do this only for target by default?

Cheers,

Richard
Hongxu Jia Dec. 16, 2025, 9:08 a.m. UTC | #2
On 12/15/25 20:02, Richard Purdie wrote:
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
> On Fri, 2025-10-10 at 15:52 +0800, hongxu via lists.openembedded.org
> wrote:
>> The debug_build.inc is used to collect debug build configuration,
>> override MESON_BUILDTYPE for meson.bbclass when DEBUG_BUILD is
>> enabled
>>
>> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
>> ---
>>   meta/classes-recipe/meson.bbclass        | 3 +--
>>   meta/conf/distro/include/debug_build.inc | 3 +++
>>   2 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/meta/classes-recipe/meson.bbclass b/meta/classes-
>> recipe/meson.bbclass
>> index c8b3e1ec29..0944ea03cc 100644
>> --- a/meta/classes-recipe/meson.bbclass
>> +++ b/meta/classes-recipe/meson.bbclass
>> @@ -28,8 +28,7 @@ MESON_INSTALL_TAGS ?= ""
>>   def noprefix(var, d):
>>       return d.getVar(var).replace(d.getVar('prefix') + '/', '', 1)
>>
>> -MESON_BUILDTYPE ?= "${@oe.utils.vartrue('DEBUG_BUILD', 'debug',
>> 'plain', d)}"
>> -MESON_BUILDTYPE[vardeps] += "DEBUG_BUILD"
>> +MESON_BUILDTYPE ??= "plain"
>>   MESONOPTS = " --prefix ${prefix} \
>>                 --buildtype ${MESON_BUILDTYPE} \
>>                 --bindir ${@noprefix('bindir', d)} \
>> diff --git a/meta/conf/distro/include/debug_build.inc
>> b/meta/conf/distro/include/debug_build.inc
>> index 1062326417..c8e2cf90cf 100644
>> --- a/meta/conf/distro/include/debug_build.inc
>> +++ b/meta/conf/distro/include/debug_build.inc
>> @@ -44,3 +44,6 @@ CXXFLAGS:append:pn-vulkan-validation-layers = " -
>> DXXH_NO_INLINE_HINTS=1"
>>   # No strip sysroot for cross and native
>>   INHIBIT_SYSROOT_STRIP:class-cross ?= "1"
>>   INHIBIT_SYSROOT_STRIP:class-native ?= "1"
>> +
>> +# For meson.bbclass
>> +MESON_BUILDTYPE ?= "debug"
> Should we do this only for target by default?

Copy

//Hongxu

> Cheers,
>
> Richard
>
diff mbox series

Patch

diff --git a/meta/classes-recipe/meson.bbclass b/meta/classes-recipe/meson.bbclass
index c8b3e1ec29..0944ea03cc 100644
--- a/meta/classes-recipe/meson.bbclass
+++ b/meta/classes-recipe/meson.bbclass
@@ -28,8 +28,7 @@  MESON_INSTALL_TAGS ?= ""
 def noprefix(var, d):
     return d.getVar(var).replace(d.getVar('prefix') + '/', '', 1)
 
-MESON_BUILDTYPE ?= "${@oe.utils.vartrue('DEBUG_BUILD', 'debug', 'plain', d)}"
-MESON_BUILDTYPE[vardeps] += "DEBUG_BUILD"
+MESON_BUILDTYPE ??= "plain"
 MESONOPTS = " --prefix ${prefix} \
               --buildtype ${MESON_BUILDTYPE} \
               --bindir ${@noprefix('bindir', d)} \
diff --git a/meta/conf/distro/include/debug_build.inc b/meta/conf/distro/include/debug_build.inc
index 1062326417..c8e2cf90cf 100644
--- a/meta/conf/distro/include/debug_build.inc
+++ b/meta/conf/distro/include/debug_build.inc
@@ -44,3 +44,6 @@  CXXFLAGS:append:pn-vulkan-validation-layers = " -DXXH_NO_INLINE_HINTS=1"
 # No strip sysroot for cross and native
 INHIBIT_SYSROOT_STRIP:class-cross ?= "1"
 INHIBIT_SYSROOT_STRIP:class-native ?= "1"
+
+# For meson.bbclass
+MESON_BUILDTYPE ?= "debug"