This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit a71c329cfb0d40c853ddff6c943aed22e34b71a6
Author: raiden00pl <[email protected]>
AuthorDate: Fri Aug 21 10:10:18 2026 +0200

    netutils/paho_mqtt: configure embedded runtime mode
    
    Expose the upstream HIGH_PERFORMANCE mode through
    CONFIG_LIB_MQTT5_HIGH_PERFORMANCE and enable it by default. This keeps
    normal embedded builds lightweight while allowing developers to restore
    Paho heap and call-stack diagnostics when investigating library issues.
    
    Signed-off-by: raiden00pl <[email protected]>
    Assisted-by: OpenAI Codex:gpt-5
---
 netutils/paho_mqtt/CMakeLists.txt | 5 +++++
 netutils/paho_mqtt/Kconfig        | 9 +++++++++
 netutils/paho_mqtt/Makefile       | 5 +++++
 3 files changed, 19 insertions(+)

diff --git a/netutils/paho_mqtt/CMakeLists.txt 
b/netutils/paho_mqtt/CMakeLists.txt
index f76d20de4..a098c0993 100644
--- a/netutils/paho_mqtt/CMakeLists.txt
+++ b/netutils/paho_mqtt/CMakeLists.txt
@@ -117,6 +117,11 @@ if(CONFIG_LIB_MQTT5)
 
   target_compile_options(mqtt5 PRIVATE ${MQTT5_FLAGS})
 
+  if(CONFIG_LIB_MQTT5_HIGH_PERFORMANCE)
+    target_compile_definitions(mqtt5 PRIVATE HIGH_PERFORMANCE=1)
+    target_compile_options(mqtt5 PRIVATE -Wno-unused-but-set-variable)
+  endif()
+
   if(CONFIG_UTILS_MQTT5)
 
     set(MQTT_PUB_FLAGS
diff --git a/netutils/paho_mqtt/Kconfig b/netutils/paho_mqtt/Kconfig
index 454ed869d..48273c08f 100644
--- a/netutils/paho_mqtt/Kconfig
+++ b/netutils/paho_mqtt/Kconfig
@@ -16,6 +16,15 @@ config LIB_MQTT5_THREAD_STACKSIZE
        ---help---
                Stack size used by threads created by the Paho MQTT library.
 
+config LIB_MQTT5_HIGH_PERFORMANCE
+       bool "Enable Paho high-performance mode"
+       default y
+       depends on LIB_MQTT5
+       ---help---
+               Disable Paho heap-allocation tracking and function call-stack
+               tracing to reduce runtime and memory overhead. Disable this 
option
+               when debugging the Paho MQTT library.
+
 config UTILS_MQTT5
        tristate "Enable mqtt5 tool"
        depends on LIB_MQTT5
diff --git a/netutils/paho_mqtt/Makefile b/netutils/paho_mqtt/Makefile
index 325a68f85..5a9575824 100644
--- a/netutils/paho_mqtt/Makefile
+++ b/netutils/paho_mqtt/Makefile
@@ -38,6 +38,11 @@ CFLAGS += $(INCDIR_PREFIX)$(SRCDIR)
 
 ifeq ($(CONFIG_LIB_MQTT5), y)
 
+ifeq ($(CONFIG_LIB_MQTT5_HIGH_PERFORMANCE),y)
+CFLAGS += -DHIGH_PERFORMANCE=1
+CFLAGS += -Wno-unused-but-set-variable
+endif
+
 # Check if paho_mqtt directory exists, if not download and extract
 ifeq ($(wildcard $(PAHO_MQTT_UNPACK)/src),)
 $(PAHO_MQTT_ZIP):

Reply via email to