Skip to content

Commit f2653f2

Browse files
author
Elms
committed
cmake: shared/static lib build and cleanup
Disables examples and crypt tests for wolfssl when added as module
1 parent fe7e469 commit f2653f2

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ set(MQTT_SOURCES
3030
src/mqtt_socket.c
3131
)
3232

33+
# default to build shared library
34+
option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" ON)
3335
add_library(wolfmqtt ${MQTT_SOURCES})
3436

3537

@@ -41,6 +43,9 @@ if (WITH_WOLFSSL)
4143
"ENABLE_MQTT_TLS"
4244
)
4345
elseif (WITH_WOLFSSL_TREE)
46+
set(WOLFSSL_EXAMPLES "no" CACHE STRING "")
47+
set(WOLFSSL_CRYPT_TESTS "no" CACHE STRING "")
48+
4449
add_subdirectory(${WITH_WOLFSSL_TREE} wolfssl)
4550
target_link_libraries(wolfmqtt PUBLIC wolfssl)
4651
target_compile_definitions(wolfmqtt PUBLIC
@@ -106,7 +111,7 @@ target_include_directories(wolfmqtt
106111
)
107112

108113

109-
if (${WOLFMQTT_EXAMPLES})
114+
if (WOLFMQTT_EXAMPLES)
110115
add_library(mqtt_test_lib STATIC
111116
examples/mqttexample.c
112117
examples/mqttnet.c

0 commit comments

Comments
 (0)