[trantor] fix: link to vcpkg c-ares target (#32735)

This commit is contained in:
Mohsen Mirkarimi 2023-07-26 09:58:18 +03:30 committed by GitHub
parent 151c42c5f4
commit ebf90b95b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,35 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 83bd458..ad56a27 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -135,7 +135,7 @@ endif()
set(HAVE_C-ARES NO)
if (BUILD_C-ARES)
- find_package(c-ares)
+ find_package(c-ares CONFIG)
if(c-ares_FOUND)
message(STATUS "c-ares found!")
set(HAVE_C-ARES TRUE)
@@ -143,7 +143,7 @@ if (BUILD_C-ARES)
endif ()
if(HAVE_C-ARES)
- target_link_libraries(${PROJECT_NAME} PRIVATE c-ares_lib)
+ target_link_libraries(${PROJECT_NAME} PRIVATE c-ares::cares)
set(TRANTOR_SOURCES
${TRANTOR_SOURCES}
trantor/net/inner/AresResolver.cc)
diff --git a/cmake/templates/TrantorConfig.cmake.in b/cmake/templates/TrantorConfig.cmake.in
index e18652d..6dad38e 100644
--- a/cmake/templates/TrantorConfig.cmake.in
+++ b/cmake/templates/TrantorConfig.cmake.in
@@ -14,7 +14,7 @@ if(@OpenSSL_FOUND@)
find_dependency(OpenSSL)
endif()
if(@c-ares_FOUND@)
- find_dependency(c-ares)
+ find_dependency(c-ares CONFIG)
endif()
find_dependency(Threads)
# Compute paths

View File

@ -5,6 +5,7 @@ vcpkg_from_github(
SHA512 dd65938bebb2e6714e5603db3bfc82cd1a63395c17dce014147a41fdc74548cb526e1457a7472aa51bb80ce629a9935b4db9eeadf735efaf30899ef73f776a58
HEAD_REF master
PATCHES
000-fix-deps.patch
)
vcpkg_cmake_configure(

View File

@ -1,6 +1,7 @@
{
"name": "trantor",
"version-semver": "1.5.11",
"port-version": 1,
"description": "A non-blocking I/O cross-platform TCP network library, using C++14",
"homepage": "https://github.com/an-tao/trantor",
"license": "BSD-2-Clause",

View File

@ -8222,7 +8222,7 @@
},
"trantor": {
"baseline": "1.5.11",
"port-version": 0
"port-version": 1
},
"tre": {
"baseline": "0.8.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "4ac910f7ba58f9ee8ceff1c8ac1d2dfa0200136f",
"version-semver": "1.5.11",
"port-version": 1
},
{
"git-tree": "bdeefc43943ee1bd39f5c46db28a89b01e446b8f",
"version-semver": "1.5.11",