[libwebsockets] Update to the latest version (#13803)

This commit is contained in:
NancyLi1013 2020-10-07 16:33:46 +08:00 committed by GitHub
parent 367bc36f3a
commit 690215da95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 42 additions and 27 deletions

View File

@ -1,22 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7772ed0..656e5a0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1767,7 +1767,7 @@ endif(LWS_WITH_LIBEV)
if (LWS_WITH_LIBUV)
diff --git a/lib/event-libs/libuv/CMakeLists.txt b/lib/event-libs/libuv/CMakeLists.txt
index fb810a8..2258ade 100644
--- a/lib/event-libs/libuv/CMakeLists.txt
+++ b/lib/event-libs/libuv/CMakeLists.txt
@@ -36,7 +36,7 @@ set(LWS_LIBUV_INCLUDE_DIRS CACHE PATH "Path to the libuv include directory")
if ("${LWS_LIBUV_LIBRARIES}" STREQUAL "" OR "${LWS_LIBUV_INCLUDE_DIRS}" STREQUAL "")
if (NOT LIBUV_FOUND)
find_path(LIBUV_INCLUDE_DIRS NAMES uv.h)
- find_library(LIBUV_LIBRARIES NAMES uv)
+ find_library(LIBUV_LIBRARIES NAMES uv libuv)
if(LIBUV_INCLUDE_DIRS AND LIBUV_LIBRARIES)
set(LIBUV_FOUND 1)
endif()
@@ -1826,7 +1826,7 @@ endif()
if (WINCE)
list(APPEND LIB_LIST ws2.lib)
elseif (WIN32)
- list(APPEND LIB_LIST ws2_32.lib userenv.lib psapi.lib iphlpapi.lib)
+ list(APPEND LIB_LIST ws2_32.lib userenv.lib psapi.lib iphlpapi.lib crypt32.lib)
endif()
if (${CMAKE_SYSTEM_NAME} MATCHES "QNX")
endif()
else()
set(LIBUV_LIBRARIES ${LWS_LIBUV_LIBRARIES})

View File

@ -1,6 +1,6 @@
Source: libwebsockets
Version: 4.0.1-1
Build-Depends: zlib, openssl, libuv
Version: 4.1.2
Build-Depends: zlib, openssl, libuv, pthreads (windows)
Homepage: https://github.com/warmcat/libwebsockets
Description: Libwebsockets is a lightweight pure C library built to use minimal CPU and memory resources, and provide fast throughput in both directions as client or server.
Supports: !(arm|uwp)

View File

@ -0,0 +1,25 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1e737e5..75534c1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -422,6 +422,11 @@ set(LWS_LIBMOUNT_LIBRARIES CACHE PATH "Path to the libmount library")
set(LWS_EXT_PTHREAD_INCLUDE_DIR CACHE PATH "Path to an external pthreads include directory")
set(LWS_EXT_PTHREAD_LIBRARIES CACHE PATH "Path to an external pthreads library")
+if(WIN32)
+ find_package(pthreads_windows REQUIRED)
+ set(LWS_EXT_PTHREAD_INCLUDE_DIR ${PThreads4W_INCLUDE_DIR})
+ set(LWS_EXT_PTHREAD_LIBRARIES ${PThreads4W_LIBRARY})
+endif()
if (LWS_WITH_HTTP_STREAM_COMPRESSION)
set(LWS_WITH_ZLIB 1)
@@ -728,7 +733,7 @@ if (MSVC)
# Turn off pointless microsoft security warnings.
add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
# Fail the build if any warnings
- add_compile_options(/W3 /WX)
+ add_compile_options(/W3 /WX /wd4142 /wd4267)
endif(MSVC)
if (MINGW)

View File

@ -3,11 +3,12 @@ vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp")
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO warmcat/libwebsockets
REF 6eb39388f43f6e2a27f0efcbf8cb2391e38824e9 # v4.0.1
SHA512 2317ab66cd642280dc5cc7c47b8efa562731cc5b4a4eda83f34b6a7b60f02df6444a818c36e84f5cf118c79d6d62a9aa2e486d18f434199abd9812e7b88941e4
REF 64232ddc4cf67ccc75683a42a322e596b3611069 # v4.1.2
SHA512 199f25b969860a436cee5d1dd210ccde0ad7aaf4836c24aa4a5d0252bb13a61b12d96529e6ebf45dc78f4ec9ade11a324a0f2de51991e9e66045b57348ce6eec
HEAD_REF master
PATCHES
CMakeLists.patch
fix-build-error.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" LWS_WITH_STATIC)
@ -148,7 +149,7 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "windows" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
if (VCPKG_TARGET_IS_WINDOWS)
vcpkg_fixup_cmake_targets(CONFIG_PATH cmake)
else()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libwebsockets)
@ -157,9 +158,9 @@ endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/libwebsockets-test-server)
file(READ ${CURRENT_PACKAGES_DIR}/share/libwebsockets/LibwebsocketsConfig.cmake LIBWEBSOCKETSCONFIG_CMAKE)
file(READ ${CURRENT_PACKAGES_DIR}/share/libwebsockets/libwebsockets-config.cmake LIBWEBSOCKETSCONFIG_CMAKE)
string(REPLACE "/../include" "/../../include" LIBWEBSOCKETSCONFIG_CMAKE "${LIBWEBSOCKETSCONFIG_CMAKE}")
file(WRITE ${CURRENT_PACKAGES_DIR}/share/libwebsockets/LibwebsocketsConfig.cmake "${LIBWEBSOCKETSCONFIG_CMAKE}")
file(WRITE ${CURRENT_PACKAGES_DIR}/share/libwebsockets/libwebsockets-config.cmake "${LIBWEBSOCKETSCONFIG_CMAKE}")
file(READ ${CURRENT_PACKAGES_DIR}/share/libwebsockets/LibwebsocketsTargets-debug.cmake LIBWEBSOCKETSTARGETSDEBUG_CMAKE)
string(REPLACE "websockets_static.lib" "websockets.lib" LIBWEBSOCKETSTARGETSDEBUG_CMAKE "${LIBWEBSOCKETSTARGETSDEBUG_CMAKE}")
file(WRITE ${CURRENT_PACKAGES_DIR}/share/libwebsockets/LibwebsocketsTargets-debug.cmake "${LIBWEBSOCKETSTARGETSDEBUG_CMAKE}")

View File

@ -905,8 +905,6 @@ libwandio:x64-windows-static=fail
libwandio:x64-uwp=fail
libwandio:arm64-windows=fail
libwandio:arm-uwp=fail
libwebsockets:arm-uwp=fail
libwebsockets:x64-uwp=fail
libxmp-lite:x64-linux=fail
libxmp-lite:x64-osx=fail
libxslt:arm-uwp=fail