[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
This commit is contained in:
JonLiu1993 2022-03-19 05:52:54 +08:00 committed by GitHub
parent cac3fe6232
commit a3df696929
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 48 additions and 2 deletions

View File

@ -0,0 +1,24 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cd9d1c3..e707884 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -112,7 +112,10 @@ endif()
if(WITH_OPENSSL)
add_definitions(-DWITH_OPENSSL)
- set(LIBS ${LIBS} ssl crypto)
+ find_package(OpenSSL REQUIRED)
+ if(OpenSSL_FOUND)
+ set(LIBS ${LIBS} OpenSSL::SSL OpenSSL::Crypto)
+ endif()
endif()
if(WITH_GNUTLS)
@@ -197,6 +200,7 @@ if(BUILD_STATIC)
add_library(hv_static STATIC ${LIBHV_SRCS})
target_compile_definitions(hv_static PRIVATE HV_STATICLIB)
target_include_directories(hv_static PRIVATE ${LIBHV_SRCDIRS})
+ target_link_libraries(hv_static ${LIBS})
install(TARGETS hv_static DESTINATION lib)
add_custom_target(libhv_static DEPENDS hv_static)
endif()

View File

@ -4,11 +4,18 @@ vcpkg_from_github(
REF v1.2.4
SHA512 5732800970180294DCEB329F25D22B1A7178739A2A5A2CE32E030F4FD38055A6298797D26E7FF5525AC662059FF0AAEDB8ABC200E0BA9E4EEBEB5846FB53F4D0
HEAD_REF master
PATCHES
fix-find_package.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
ssl WITH_OPENSSL
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
DISABLE_PARALLEL_CONFIGURE
@ -17,6 +24,7 @@ vcpkg_cmake_configure(
-DBUILD_UNITTEST=OFF
-DBUILD_STATIC=${BUILD_STATIC}
-DBUILD_SHARED=${BUILD_SHARED}
${FEATURE_OPTIONS}
)
vcpkg_cmake_install()

View File

@ -1,6 +1,7 @@
{
"name": "libhv",
"version": "1.2.4",
"port-version": 1,
"description": "Libhv is a C/C++ network library similar to libevent/libuv.",
"homepage": "https://github.com/ithewei/libhv",
"license": "BSD-3-Clause",
@ -10,5 +11,13 @@
"name": "vcpkg-cmake",
"host": true
}
]
],
"features": {
"ssl": {
"description": "with openssl library",
"dependencies": [
"openssl"
]
}
}
}

View File

@ -3610,7 +3610,7 @@
},
"libhv": {
"baseline": "1.2.4",
"port-version": 0
"port-version": 1
},
"libhydrogen": {
"baseline": "2021-12-02",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "b5953fb3634520fafd04507d0a7266e92c87a129",
"version": "1.2.4",
"port-version": 1
},
{
"git-tree": "9867c0ba3cb7de25db2dd22fdd5633de7faae440",
"version": "1.2.4",