]> prime8.dev >> repos - ttyd.git/commitdiff
cmake: fix mbedtls build
authorShuanglei Tao <tsl0922@gmail.com>
Wed, 30 Dec 2020 13:23:33 +0000 (21:23 +0800)
committerShuanglei Tao <tsl0922@gmail.com>
Wed, 30 Dec 2020 13:23:51 +0000 (21:23 +0800)
CMakeLists.txt

index 4e27924a5e477a27d35dddea248b41a1955471f6..9b28c15b4d3d6cd078ce5e1d34a05f77d463dc8e 100644 (file)
@@ -70,7 +70,8 @@ set(LINK_LIBS ${ZLIB_LIBRARIES} ${LIBWEBSOCKETS_LIBRARIES} ${JSON-C_LIBRARIES} $
 set (CMAKE_REQUIRED_INCLUDES ${INCLUDE_DIRS})
 include(CheckSymbolExists)
 check_symbol_exists(LWS_OPENSSL_SUPPORT "lws_config.h" LWS_OPENSSL_ENABLED)
-if(LWS_OPENSSL_ENABLED)
+check_symbol_exists(LWS_WITH_MBEDTLS "lws_config.h" LWS_MBEDTLS_ENABLED)
+if(LWS_OPENSSL_ENABLED AND NOT LWS_MBEDTLS_ENABLED)
     find_package(OpenSSL REQUIRED)
     list(APPEND INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
     list(APPEND LINK_LIBS ${OPENSSL_LIBRARIES})