diff options
| author | Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> | 2021-04-08 04:12:01 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-07 13:12:01 -0700 |
| commit | ff615bb6a94aba978c7c1efdf569b519f61c2ead (patch) | |
| tree | 5167caec32a9cd13ff4e2dffd620653b150f2ff7 | |
| parent | 3320069be1b70775071f31b347dde8c6b7757870 (diff) | |
| download | vcpkg-ff615bb6a94aba978c7c1efdf569b519f61c2ead.tar.gz vcpkg-ff615bb6a94aba978c7c1efdf569b519f61c2ead.zip | |
[libwebsockets] Fix usage, export include path (#17003)
* [libwebsockets] Fix usage, export include path
* update version record
| -rw-r--r-- | ports/libwebsockets/CONTROL | 7 | ||||
| -rw-r--r-- | ports/libwebsockets/export-include-path.patch | 48 | ||||
| -rw-r--r-- | ports/libwebsockets/fix-dependency-libuv.patch (renamed from ports/libwebsockets/CMakeLists.patch) | 0 | ||||
| -rw-r--r-- | ports/libwebsockets/portfile.cmake | 5 | ||||
| -rw-r--r-- | ports/libwebsockets/vcpkg.json | 17 | ||||
| -rw-r--r-- | versions/baseline.json | 2 | ||||
| -rw-r--r-- | versions/l-/libwebsockets.json | 5 |
7 files changed, 74 insertions, 10 deletions
diff --git a/ports/libwebsockets/CONTROL b/ports/libwebsockets/CONTROL deleted file mode 100644 index 5a0b5d2b7..000000000 --- a/ports/libwebsockets/CONTROL +++ /dev/null @@ -1,7 +0,0 @@ -Source: libwebsockets -Version: 4.1.6 -Port-Version: 0 -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) diff --git a/ports/libwebsockets/export-include-path.patch b/ports/libwebsockets/export-include-path.patch new file mode 100644 index 000000000..562c71285 --- /dev/null +++ b/ports/libwebsockets/export-include-path.patch @@ -0,0 +1,48 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 06d9eec..5606601 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -840,8 +840,8 @@ else() + set(DEF_INSTALL_CMAKE_DIR lib${LIB_SUFFIX}/cmake/libwebsockets) + endif() + +-if (DEFINED REL_INCLUDE_DIR) +- set(LWS__INCLUDE_DIRS "\${LWS_CMAKE_DIR}/${REL_INCLUDE_DIR}") ++if (1) ++ set(LWS__INCLUDE_DIRS "\${CMAKE_CURRENT_LIST_DIR}/../include") + endif() + + configure_file(${PROJECT_SOURCE_DIR}/cmake/libwebsockets-config.cmake.in +@@ -853,10 +853,6 @@ configure_file(${PROJECT_SOURCE_DIR}/cmake/libwebsockets-config-version.cmake.in + ${PROJECT_BINARY_DIR}/libwebsockets-config-version.cmake + @ONLY) + +-# Generate the config file for the build-tree. +-set(LWS__INCLUDE_DIRS +- "${PROJECT_SOURCE_DIR}/lib" +- "${PROJECT_BINARY_DIR}") + set(LIBWEBSOCKETS_INCLUDE_DIRS ${LWS__INCLUDE_DIRS} CACHE PATH "Libwebsockets include directories") + configure_file(${PROJECT_SOURCE_DIR}/cmake/libwebsockets-config.cmake.in + ${PROJECT_BINARY_DIR}/libwebsockets-config.cmake +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index 82b9170..eab2bf0 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -153,7 +153,7 @@ if (LWS_WITH_STATIC) + add_library(websockets STATIC ${SOURCES})# ${HDR_PUBLIC}) + set_target_properties(websockets PROPERTIES LINKER_LANGUAGE C) + list(APPEND LWS_LIBRARIES websockets) +- target_include_directories(websockets PRIVATE ${LWS_LIB_BUILD_INC_PATHS}) ++ target_include_directories(websockets PRIVATE $<BUILD_INTERFACE:${LWS_LIB_BUILD_INC_PATHS}> PUBLIC $<INSTALL_INTERFACE:include>) + + if (WIN32) + # Windows uses the same .lib ending for static libraries and shared +@@ -173,7 +173,7 @@ if (LWS_WITH_SHARED) + add_library(websockets_shared SHARED ${SOURCES} ${RESOURCES})# ${HDR_PUBLIC}) + set_target_properties(websockets_shared PROPERTIES LINKER_LANGUAGE C) + list(APPEND LWS_LIBRARIES websockets_shared) +- target_include_directories(websockets_shared PRIVATE ${LWS_LIB_BUILD_INC_PATHS}) ++ target_include_directories(websockets_shared PRIVATE $<BUILD_INTERFACE:${LWS_LIB_BUILD_INC_PATHS}> PUBLIC $<INSTALL_INTERFACE:include>) + + # We want the shared lib to be named "libwebsockets" + # not "libwebsocket_shared". diff --git a/ports/libwebsockets/CMakeLists.patch b/ports/libwebsockets/fix-dependency-libuv.patch index 1c63d2587..1c63d2587 100644 --- a/ports/libwebsockets/CMakeLists.patch +++ b/ports/libwebsockets/fix-dependency-libuv.patch diff --git a/ports/libwebsockets/portfile.cmake b/ports/libwebsockets/portfile.cmake index 9c8292a3c..c617c96ab 100644 --- a/ports/libwebsockets/portfile.cmake +++ b/ports/libwebsockets/portfile.cmake @@ -7,8 +7,9 @@ vcpkg_from_github( SHA512 7632439f8cdc87d275a0524b87ea5cd19c3401c1b7bb7fcf673eef3e1ab36c0ec022d2dce050d07bc106af3166575882507a56ac829a4361329311484dc2c5c4 HEAD_REF master PATCHES - CMakeLists.patch - fix-build-error.patch + fix-dependency-libuv.patch + fix-build-error.patch + export-include-path.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" LWS_WITH_STATIC) diff --git a/ports/libwebsockets/vcpkg.json b/ports/libwebsockets/vcpkg.json new file mode 100644 index 000000000..946c4b611 --- /dev/null +++ b/ports/libwebsockets/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "libwebsockets", + "version-semver": "4.1.6", + "port-version": 1, + "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.", + "homepage": "https://github.com/warmcat/libwebsockets", + "supports": "!(arm | uwp)", + "dependencies": [ + "libuv", + "openssl", + { + "name": "pthreads", + "platform": "!windows" + }, + "zlib" + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index eae3befe0..47004fa8a 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3602,7 +3602,7 @@ }, "libwebsockets": { "baseline": "4.1.6", - "port-version": 0 + "port-version": 1 }, "libxdiff": { "baseline": "0.23", diff --git a/versions/l-/libwebsockets.json b/versions/l-/libwebsockets.json index 5c281f316..fa9b5e9e1 100644 --- a/versions/l-/libwebsockets.json +++ b/versions/l-/libwebsockets.json @@ -1,6 +1,11 @@ { "versions": [ { + "git-tree": "1846ac46a72330104a9a4c13042cdb19ae8a42c4", + "version-semver": "4.1.6", + "port-version": 1 + }, + { "git-tree": "d980cd5098de3cfba2ecd8e63490cf1013545dfd", "version-string": "4.1.6", "port-version": 0 |
