Thread (10 messages) flat view 10 messages, 2 authors, 2021-02-12

[Buildroot] [PATCH 2/7] core: enable 'NDEBUG' unless BR2_ENABLE_RUNTIME_DEBUG is set

From: Thomas De Schampheleire <hidden>
Date: 2021-02-10 14:12:51
Subsystem: the rest · Maintainer: Linus Torvalds

From: Thomas De Schampheleire <redacted>

A common way to disable runtime assertions is by honoring the 'NDEBUG'
preprocessor flag. Set it when BR2_ENABLE_RUNTIME_DEBUG is disabled (the
default case).

Signed-off-by: Thomas De Schampheleire <redacted>
---
 package/Makefile.in | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/package/Makefile.in b/package/Makefile.in
index 51f5cbce4f..9a18c05c6f 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -145,6 +145,9 @@ endif
 ifeq ($(BR2_DEBUG_3),y)
 TARGET_DEBUGGING = -g3
 endif
+ifeq ($(BR2_ENABLE_RUNTIME_DEBUG),)
+TARGET_DEBUGGING += -DNDEBUG
+endif
 
 TARGET_LDFLAGS = $(call qstrip,$(BR2_TARGET_LDFLAGS))
 
-- 
2.26.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help