From: Shuanglei Tao Date: Sun, 28 Mar 2021 04:18:18 +0000 (+0800) Subject: cmake: find libwebsockts manually X-Git-Url: http://git.prime8.dev/?a=commitdiff_plain;h=b33f3135ca228bf4a2628f04a3d044502bdc0150;p=ttyd.git cmake: find libwebsockts manually --- diff --git a/CMakeLists.txt b/CMakeLists.txt index ae5915e..0da04ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ if(GIT_FOUND) endif() endif() -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE -Wvla") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE") if(CMAKE_VERSION VERSION_LESS "3.1") if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") @@ -43,7 +43,7 @@ endif() find_path(JSON-C_INCLUDE_DIR NAMES json.h PATH_SUFFIXES json-c) find_library(JSON-C_LIBRARY NAMES json-c) -find_package_handle_standard_args(JSON-C REQUIRED_VARS JSON-C_INCLUDE_DIR JSON-C_LIBRARY) +find_package_handle_standard_args(JSON-C REQUIRED_VARS JSON-C_LIBRARY JSON-C_INCLUDE_DIR) mark_as_advanced(JSON-C_INCLUDE_DIR JSON-C_LIBRARY) if(JSON-C_FOUND) SET(JSON-C_INCLUDE_DIRS "${JSON-C_INCLUDE_DIR}") @@ -56,9 +56,9 @@ find_package(Libwebsockets 1.7.0 QUIET) if(NOT Libwebsockets_FOUND) # for libwebsockets-dev on ubuntu 16.04 find_path(LIBWEBSOCKETS_INCLUDE_DIR NAMES libwebsockets.h) find_library(LIBWEBSOCKETS_LIBRARY NAMES websockets) - find_package_handle_standard_args(Libwebsockets REQUIRED_VARS LIBWEBSOCKETS_LIBRARY LIBWEBSOCKETS_INCLUDE_DIR) + find_package_handle_standard_args(LIBWEBSOCKETS REQUIRED_VARS LIBWEBSOCKETS_LIBRARY LIBWEBSOCKETS_INCLUDE_DIR) mark_as_advanced(LIBWEBSOCKETS_INCLUDE_DIR LIBWEBSOCKETS_LIBRARY) - if(Libwebsockets_FOUND) + if(LIBWEBSOCKETS_FOUND) SET(LIBWEBSOCKETS_INCLUDE_DIRS "${LIBWEBSOCKETS_INCLUDE_DIR}") SET(LIBWEBSOCKETS_LIBRARIES "${LIBWEBSOCKETS_LIBRARY}") endif() @@ -78,7 +78,7 @@ if(LWS_OPENSSL_ENABLED AND NOT LWS_MBEDTLS_ENABLED) endif() if(WIN32) - list(APPEND LINK_LIBS shell32) + list(APPEND LINK_LIBS shell32 ws2_32) elseif(NOT APPLE) list(APPEND LINK_LIBS util) endif()