diff --git a/CMakeLists.txt b/CMakeLists.txt index 193ff0bcd..b8fe432b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,6 +80,9 @@ endif() option(WITH_WEBSOCKETS "Include websockets support?" ON) option(WITH_WEBSOCKETS_BUILTIN "Websockets support uses builtin library? Set OFF to use libwebsockets" ON) +if(WITH_WEBSOCKETS AND NOT WITH_TLS) + message(FATAL_ERROR "WITH_WEBSOCKETS support requires WITH_TLS.") +endif() option(WITH_SRV "Include SRV lookup support?" OFF) option(WITH_STATIC_LIBRARIES "Build static versions of the libmosquitto/pp libraries?" OFF) option(WITH_PIC "Build the static library with PIC (Position Independent Code) enabled archives?" OFF) diff --git a/apps/mosquitto_ctrl/Makefile b/apps/mosquitto_ctrl/Makefile index 3679d185d..d54d10aff 100644 --- a/apps/mosquitto_ctrl/Makefile +++ b/apps/mosquitto_ctrl/Makefile @@ -55,11 +55,7 @@ OBJS_EXTERNAL= \ EXAMPLE_OBJS= example.o -ifeq ($(WITH_TLS),yes) TARGET:=mosquitto_ctrl mosquitto_ctrl_example.so -else -TARGET:= -endif all : ${TARGET} diff --git a/config.mk b/config.mk index 6b9d11f6e..a9eff09c4 100644 --- a/config.mk +++ b/config.mk @@ -271,7 +271,9 @@ ifeq ($(WITH_UNIX_SOCKETS),yes) endif ifeq ($(WITH_WEBSOCKETS),yes) - LOCAL_CPPFLAGS+=-DWITH_WEBSOCKETS=WS_IS_BUILTIN -I${R}/deps/picohttpparser + ifeq ($(WITH_TLS),yes) + LOCAL_CPPFLAGS+=-DWITH_WEBSOCKETS=WS_IS_BUILTIN -I${R}/deps/picohttpparser + endif endif ifeq ($(WITH_WEBSOCKETS),lws) diff --git a/test/unit/libcommon/base64_test.c b/test/unit/libcommon/base64_test.c index 0dcf89bb2..db3011742 100644 --- a/test/unit/libcommon/base64_test.c +++ b/test/unit/libcommon/base64_test.c @@ -11,6 +11,7 @@ //int mosquitto_base64_decode(const char *in, unsigned char **decoded, unsigned int *decoded_len); +#ifdef WITH_TLS static void check_encode(const char *input, size_t in_len, const char *expected_output) { char *encoded; @@ -159,3 +160,4 @@ int init_base64_tests(void) return 0; } +#endif diff --git a/test/unit/libcommon/test.c b/test/unit/libcommon/test.c index faca05849..5aab8829c 100644 --- a/test/unit/libcommon/test.c +++ b/test/unit/libcommon/test.c @@ -27,7 +27,9 @@ int main(int argc, char *argv[]) } if(0 +#ifdef WITH_TLS || init_base64_tests() +#endif || init_file_tests() || init_property_add_tests() || init_property_value_tests()