Skip to content

Commit a3df696

Browse files
authored
[libhv] add ssl support (#23198)
* [libhv] add ssl support * update version * [libhv] add ssl support * fix version * update version * revert git-tree * Add license * update version * update version * update version * [libhv] add ssl support * update version * update portfile.cmake * update version
1 parent cac3fe6 commit a3df696

5 files changed

Lines changed: 48 additions & 2 deletions

File tree

ports/libhv/fix-find_package.patch

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index cd9d1c3..e707884 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -112,7 +112,10 @@ endif()
6+
7+
if(WITH_OPENSSL)
8+
add_definitions(-DWITH_OPENSSL)
9+
- set(LIBS ${LIBS} ssl crypto)
10+
+ find_package(OpenSSL REQUIRED)
11+
+ if(OpenSSL_FOUND)
12+
+ set(LIBS ${LIBS} OpenSSL::SSL OpenSSL::Crypto)
13+
+ endif()
14+
endif()
15+
16+
if(WITH_GNUTLS)
17+
@@ -197,6 +200,7 @@ if(BUILD_STATIC)
18+
add_library(hv_static STATIC ${LIBHV_SRCS})
19+
target_compile_definitions(hv_static PRIVATE HV_STATICLIB)
20+
target_include_directories(hv_static PRIVATE ${LIBHV_SRCDIRS})
21+
+ target_link_libraries(hv_static ${LIBS})
22+
install(TARGETS hv_static DESTINATION lib)
23+
add_custom_target(libhv_static DEPENDS hv_static)
24+
endif()

ports/libhv/portfile.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,18 @@ vcpkg_from_github(
44
REF v1.2.4
55
SHA512 5732800970180294DCEB329F25D22B1A7178739A2A5A2CE32E030F4FD38055A6298797D26E7FF5525AC662059FF0AAEDB8ABC200E0BA9E4EEBEB5846FB53F4D0
66
HEAD_REF master
7+
PATCHES
8+
fix-find_package.patch
79
)
810

911
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)
1012
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED)
1113

14+
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
15+
FEATURES
16+
ssl WITH_OPENSSL
17+
)
18+
1219
vcpkg_cmake_configure(
1320
SOURCE_PATH "${SOURCE_PATH}"
1421
DISABLE_PARALLEL_CONFIGURE
@@ -17,6 +24,7 @@ vcpkg_cmake_configure(
1724
-DBUILD_UNITTEST=OFF
1825
-DBUILD_STATIC=${BUILD_STATIC}
1926
-DBUILD_SHARED=${BUILD_SHARED}
27+
${FEATURE_OPTIONS}
2028
)
2129

2230
vcpkg_cmake_install()

ports/libhv/vcpkg.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "libhv",
33
"version": "1.2.4",
4+
"port-version": 1,
45
"description": "Libhv is a C/C++ network library similar to libevent/libuv.",
56
"homepage": "https://github.com/ithewei/libhv",
67
"license": "BSD-3-Clause",
@@ -10,5 +11,13 @@
1011
"name": "vcpkg-cmake",
1112
"host": true
1213
}
13-
]
14+
],
15+
"features": {
16+
"ssl": {
17+
"description": "with openssl library",
18+
"dependencies": [
19+
"openssl"
20+
]
21+
}
22+
}
1423
}

versions/baseline.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3610,7 +3610,7 @@
36103610
},
36113611
"libhv": {
36123612
"baseline": "1.2.4",
3613-
"port-version": 0
3613+
"port-version": 1
36143614
},
36153615
"libhydrogen": {
36163616
"baseline": "2021-12-02",

versions/l-/libhv.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"versions": [
3+
{
4+
"git-tree": "b5953fb3634520fafd04507d0a7266e92c87a129",
5+
"version": "1.2.4",
6+
"port-version": 1
7+
},
38
{
49
"git-tree": "9867c0ba3cb7de25db2dd22fdd5633de7faae440",
510
"version": "1.2.4",

0 commit comments

Comments
 (0)