Bug 13627

Summary: Align setting of NDEBUG define in build system classes
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Martin <marejde>
Component: devtools / tool chainAssignee: Changqing Li <changqing.li>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: Medium CC: meta.mr.watcher, meta.watcher, randy.macleod
Version: unspecified   
Target Milestone: 4.99   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Martin 2019-11-15 08:48:37 UTC
Noticed that assert() behaviour is different between the cmake.bbclass (passes -DNDEBUG in release [1]) and meson.bbclass (does not pass -DNDEBUG [2]). It also looks to me like the autotools.bbclass does not pass -DNDEBUG but I have not tried to verify this.

Does it make sense to align the different classes so that -DNDEBUG is passed in release builds for all build systems?


[1] http://cgit.openembedded.org/openembedded-core/tree/meta/classes/cmake.bbclass?id=3f91512ffc8c1c3374b3a67df5f86e884c78d7a1#n47

[2] Tested building a Meson project on thud and could trigger an assert(). It does not look like it has changed on master: http://cgit.openembedded.org/openembedded-core/tree/meta/classes/meson.bbclass?id=3f91512ffc8c1c3374b3a67df5f86e884c78d7a1
Comment 1 Changqing Li 2019-12-04 07:11:41 UTC
I think we don't have to align the different class. 
1. the build system class is used by different recipes, and they can have different configuration. 
2. we have different build system,  they have different default usage about this.


for cmake.bbclass and meson.bbclass, they have similar mechanism,  NDEBUG can be set to switch by buildtype by some options


for autotools, I think  need to set this in configure.ac per recipe. 


another one for distutils, seems enable DNDEBUG by default.
Comment 2 Randy MacLeod 2022-11-03 15:29:40 UTC
RP agrees that this should be system specific as Changqing stated.
-- From: YP bug review meeting