Skip to content

Commit

Permalink
[libwebsockets] Fix build error on Linux (#6855)
Browse files Browse the repository at this point in the history
  • Loading branch information
LilyWangL authored and Rastaban committed Jun 17, 2019
1 parent ba0b34c commit b4ae1fb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 105 deletions.
99 changes: 0 additions & 99 deletions ports/libwebsockets/0001-Fix-UWP.patch

This file was deleted.

2 changes: 1 addition & 1 deletion ports/libwebsockets/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: libwebsockets
Version: 3.1.0
Version: 3.1.0-1
Build-Depends: zlib, openssl
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.
14 changes: 9 additions & 5 deletions ports/libwebsockets/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ vcpkg_from_github(
REF v3.1.0
SHA512 e2a4c1b25bc6f028654a63fc01a2732e6c63414868f8d3d01fa477752fdabe0f61e8d271fe7dd2734db0e15b1250f6b0101285b6d694f971ec4bf67ba7ee067c
HEAD_REF master
PATCHES
0001-Fix-UWP.patch
)

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" LWS_WITH_STATIC)
Expand All @@ -28,7 +26,11 @@ vcpkg_configure_cmake(

vcpkg_install_cmake()

vcpkg_fixup_cmake_targets(CONFIG_PATH "cmake")
if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "windows" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
vcpkg_fixup_cmake_targets(CONFIG_PATH "cmake")
else()
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/libwebsockets" TARGET_PATH "share/libwebsockets")
endif()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
Expand All @@ -45,7 +47,9 @@ file(WRITE ${CURRENT_PACKAGES_DIR}/share/libwebsockets/LibwebsocketsTargets-rele
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libwebsockets)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libwebsockets/LICENSE ${CURRENT_PACKAGES_DIR}/share/libwebsockets/copyright)
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/websockets_static.lib ${CURRENT_PACKAGES_DIR}/debug/lib/websockets.lib)
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/websockets_static.lib ${CURRENT_PACKAGES_DIR}/lib/websockets.lib)
if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "windows" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/websockets_static.lib ${CURRENT_PACKAGES_DIR}/debug/lib/websockets.lib)
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/websockets_static.lib ${CURRENT_PACKAGES_DIR}/lib/websockets.lib)
endif()
endif ()
vcpkg_copy_pdbs()

0 comments on commit b4ae1fb

Please sign in to comment.