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 <raiden00@railab.me>
Assisted-by: OpenAI Codex:gpt-5
This commit is contained in:
raiden00pl 2026-08-21 10:10:18 +02:00 committed by Alan C. Assis
parent 53c234880c
commit a71c329cfb
3 changed files with 19 additions and 0 deletions

View file

@ -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

View file

@ -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

View file

@ -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):