Skip to content

Commit 4e7268d

Browse files
committed
Portability improvements
1 parent eeae5f5 commit 4e7268d

4 files changed

Lines changed: 949 additions & 315 deletions

File tree

CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,14 @@ if(ENABLE_WEBSOCKET)
184184
endif()
185185
endif()
186186

187+
# Broker
188+
add_option(WOLFMQTT_BROKER
189+
"Enable lightweight broker support"
190+
"no" "yes;no")
191+
if (WOLFMQTT_BROKER)
192+
list(APPEND WOLFMQTT_DEFINITIONS "-DWOLFMQTT_BROKER")
193+
endif()
194+
187195
# Note: not adding stress option to cmake build as of yet. stress is for
188196
# testing only and requires the scripts/ dir to be useful.
189197

@@ -286,6 +294,14 @@ if (WOLFMQTT_EXAMPLES)
286294
add_mqtt_example(mqtt-sub pub-sub/mqtt-sub.c)
287295
endif()
288296

297+
if (WOLFMQTT_BROKER)
298+
add_executable(mqtt_broker src/mqtt_broker.c)
299+
target_link_libraries(mqtt_broker wolfmqtt)
300+
target_include_directories(mqtt_broker PRIVATE
301+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
302+
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
303+
endif()
304+
289305
####################################################
290306
# Installation
291307
####################################################
@@ -326,4 +342,5 @@ message("\tExamples: ${ENABLE_EXAMPLES}")
326342
message("\tFirmware Examples: ${ENABLE_FIRMWARE_EXAMPLES}")
327343
message("\tMultithread: ${ENABLE_MULTITHREAD}")
328344
message("\tCurl: ${ENABLE_CURL}")
345+
message("\tBroker: ${WOLFMQTT_BROKER}")
329346
message("-----------------------------------------------")

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,3 +557,4 @@ echo " * CURL: $ENABLED_CURL"
557557
echo " * Multi-thread: $ENABLED_MULTITHREAD"
558558
echo " * Stress: $ENABLED_STRESS"
559559
echo " * WebSocket: $ENABLED_WEBSOCKET"
560+
echo " * Broker: $ENABLED_BROKER"

0 commit comments

Comments
 (0)