Skip to content

Commit

Permalink
bugfix - Issue 410
Browse files Browse the repository at this point in the history
Update CMakeLists.txt
Move check for WolfSSL package inside flag checking for use of SSL/TLS.
This allows building without TLS using CMake

Signed-off-by: Charles Stevens <chazste@yahoo.com>
  • Loading branch information
chazste committed Nov 16, 2024
1 parent d5b9743 commit b7eddb7
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,23 @@ option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static on
add_library(wolfmqtt ${MQTT_SOURCES})



set(WOLFMQTT_EXAMPLES "yes" CACHE BOOL
"Build examples")

target_compile_definitions(wolfmqtt PRIVATE
"BUILDING_WOLFMQTT"
)

# Tell mqtt_types.h we are using a ./configure like output / options.h
target_compile_definitions(wolfmqtt PRIVATE
"BUILDING_CMAKE"
)

add_option(WOLFMQTT_TLS
"Enable TLS support with wolfSSL"
"yes" "yes;no")
if (WOLFMQTT_TLS)
if (WITH_WOLFSSL)
target_link_libraries(wolfmqtt PUBLIC wolfssl)
target_include_directories(wolfmqtt PUBLIC ${WITH_WOLFSSL}/include)
Expand Down Expand Up @@ -71,23 +88,6 @@ else()
endif()
endif()


set(WOLFMQTT_EXAMPLES "yes" CACHE BOOL
"Build examples")

target_compile_definitions(wolfmqtt PRIVATE
"BUILDING_WOLFMQTT"
)

# Tell mqtt_types.h we are using a ./configure like output / options.h
target_compile_definitions(wolfmqtt PRIVATE
"BUILDING_CMAKE"
)

add_option(WOLFMQTT_TLS
"Enable TLS support with wolfSSL"
"yes" "yes;no")
if (WOLFMQTT_TLS)
list(APPEND WOLFMQTT_DEFINITIONS "-DENABLE_MQTT_TLS")
endif()

Expand Down

0 comments on commit b7eddb7

Please sign in to comment.