diff --git a/Kconfig b/Kconfig index f5dcc67996..87fefc98b1 100644 --- a/Kconfig +++ b/Kconfig @@ -557,6 +557,10 @@ endmenu # Customize Header Files menu "Debug Options" +config NDEBUG + bool "Define NDEBUG globally" + default y + config DEBUG_ALERT bool default n diff --git a/tools/Config.mk b/tools/Config.mk index fb80439433..7a0700b08a 100644 --- a/tools/Config.mk +++ b/tools/Config.mk @@ -535,6 +535,9 @@ endef # ARCHxxx means the predefined setting(either toolchain, arch, or system specific) ARCHDEFINES += ${shell $(DEFINE) "$(CC)" __NuttX__} +ifeq ($(CONFIG_NDEBUG),y) + ARCHDEFINES += ${shell $(DEFINE) "$(CC)" NDEBUG} +endif # The default C/C++ search path