[Buildroot] [PATCHv2 2/7] core: enable 'NDEBUG' unless BR2_ENABLE_RUNTIME_DEBUG is set
Thomas De Schampheleire
patrickdepinguin at gmail.com
Fri Feb 12 13:54:45 UTC 2021
From: Thomas De Schampheleire <thomas.de_schampheleire at nokia.com>
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 <thomas.de_schampheleire at nokia.com>
---
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
More information about the buildroot
mailing list