]> prime8.dev >> repos - ttyd.git/commitdiff
cmake: add openssl check back
authorShuanglei Tao <tsl0922@gmail.com>
Wed, 30 Dec 2020 13:06:53 +0000 (21:06 +0800)
committerShuanglei Tao <tsl0922@gmail.com>
Wed, 30 Dec 2020 13:06:53 +0000 (21:06 +0800)
CMakeLists.txt

index e41c629d16acd4ecbd519e2d98b03868d44b6328..4e27924a5e477a27d35dddea248b41a1955471f6 100644 (file)
@@ -67,6 +67,15 @@ endif()
 set(INCLUDE_DIRS ${ZLIB_INCLUDE_DIR} ${LIBWEBSOCKETS_INCLUDE_DIRS} ${JSON-C_INCLUDE_DIRS} ${LIBUV_INCLUDE_DIRS})
 set(LINK_LIBS ${ZLIB_LIBRARIES} ${LIBWEBSOCKETS_LIBRARIES} ${JSON-C_LIBRARIES} ${LIBUV_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)
+    find_package(OpenSSL REQUIRED)
+    list(APPEND INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
+    list(APPEND LINK_LIBS ${OPENSSL_LIBRARIES})
+endif()
+
 if(WIN32)
     list(APPEND LINK_LIBS shell32)
 elseif(NOT APPLE)