]> prime8.dev >> repos - ttyd.git/commitdiff
cmake: check libuv support of libwebsockets
authorShuanglei Tao <tsl0922@gmail.com>
Sat, 28 Aug 2021 00:26:13 +0000 (08:26 +0800)
committerShuanglei Tao <tsl0922@gmail.com>
Sat, 28 Aug 2021 00:26:13 +0000 (08:26 +0800)
CMakeLists.txt

index f1ffd5b9142dd27037d81190cd1f17418d81a32e..822c8fb4b935bccabce665bb832ec7a7fc2675d5 100644 (file)
@@ -58,8 +58,12 @@ set(LINK_LIBS ${ZLIB_LIBRARIES} ${LIBWEBSOCKETS_LIBRARIES} ${JSON-C_LIBRARIES} $
 
 set (CMAKE_REQUIRED_INCLUDES ${INCLUDE_DIRS})
 include(CheckSymbolExists)
+check_symbol_exists(LWS_WITH_LIBUV "lws_config.h" LWS_WITH_LIBUV)
 check_symbol_exists(LWS_OPENSSL_SUPPORT "lws_config.h" LWS_OPENSSL_ENABLED)
 check_symbol_exists(LWS_WITH_MBEDTLS "lws_config.h" LWS_MBEDTLS_ENABLED)
+if(NOT LWS_WITH_LIBUV)
+    message(FATAL_ERROR "libwebsockets was not build with libuv support (-DLWS_WITH_LIBUV=ON)")
+endif()
 if(LWS_OPENSSL_ENABLED AND NOT LWS_MBEDTLS_ENABLED)
     find_package(OpenSSL REQUIRED)
     list(APPEND INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})