From 60350f3757a7a5557f8994ea5efb99dda4641ff6 Mon Sep 17 00:00:00 2001 From: David Garske Date: Mon, 6 May 2024 11:08:05 -0700 Subject: [PATCH] Fix Zephyr example. --- zephyr/CMakeLists.txt | 6 ++++++ zephyr/samples/client/user_settings.h | 5 +++++ zephyr/samples/client_tls/user_settings.h | 5 +++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index c0d21113b..7a69f2a8c 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -5,4 +5,10 @@ if(CONFIG_WOLFMQTT) FILE(GLOB wolfmqtt_sources ${ZEPHYR_CURRENT_MODULE_DIR}/src/*.c) target_sources(app PRIVATE ${wolfmqtt_sources}) add_definitions(-DWOLFMQTT_ZEPHYR) + + if(CONFIG_WOLFMQTT_SETTINGS_FILE) + target_compile_definitions(wolfmqtt INTERFACE + WOLFMQTT_SETTINGS_FILE="${CONFIG_WOLFMQTT_SETTINGS_FILE}" + ) + endif() endif() diff --git a/zephyr/samples/client/user_settings.h b/zephyr/samples/client/user_settings.h index 3e7768c2e..6c9044db2 100644 --- a/zephyr/samples/client/user_settings.h +++ b/zephyr/samples/client/user_settings.h @@ -5,6 +5,11 @@ extern "C" { #endif +/* If a custom user_settings file is provided use it instead */ +#ifdef WOLFMQTT_SETTINGS_FILE +#include WOLFMQTT_SETTINGS_FILE +#endif + #undef NO_FILESYSTEM #define NO_FILESYSTEM diff --git a/zephyr/samples/client_tls/user_settings.h b/zephyr/samples/client_tls/user_settings.h index c0a567390..98288b0d5 100644 --- a/zephyr/samples/client_tls/user_settings.h +++ b/zephyr/samples/client_tls/user_settings.h @@ -5,8 +5,9 @@ extern "C" { #endif -#ifdef CONFIG_WOLFSSL_SETTINGS_FILE -#include CONFIG_WOLFSSL_SETTINGS_FILE +/* If a custom user_settings file is provided use it instead */ +#ifdef WOLFMQTT_SETTINGS_FILE +#include WOLFMQTT_SETTINGS_FILE #endif #undef NO_FILESYSTEM