File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -184,6 +184,14 @@ if(ENABLE_WEBSOCKET)
184184 endif ()
185185endif ()
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 )
287295endif ()
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}")
326342message ("\t Firmware Examples: ${ENABLE_FIRMWARE_EXAMPLES} " )
327343message ("\t Multithread: ${ENABLE_MULTITHREAD} " )
328344message ("\t Curl: ${ENABLE_CURL} " )
345+ message ("\t Broker: ${WOLFMQTT_BROKER} " )
329346message ("-----------------------------------------------" )
Original file line number Diff line number Diff line change @@ -557,3 +557,4 @@ echo " * CURL: $ENABLED_CURL"
557557echo " * Multi-thread: $ENABLED_MULTITHREAD"
558558echo " * Stress: $ENABLED_STRESS"
559559echo " * WebSocket: $ENABLED_WEBSOCKET"
560+ echo " * Broker: $ENABLED_BROKER"
You can’t perform that action at this time.
0 commit comments