Skip to content

Commit

Permalink
[trantor] fix: link to vcpkg c-ares target (microsoft#32735)
Browse files Browse the repository at this point in the history
  • Loading branch information
cthulhu-irl authored Jul 26, 2023
1 parent 151c42c commit ebf90b9
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 1 deletion.
35 changes: 35 additions & 0 deletions ports/trantor/000-fix-deps.patch
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions ports/trantor/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ vcpkg_from_github(
SHA512 dd65938bebb2e6714e5603db3bfc82cd1a63395c17dce014147a41fdc74548cb526e1457a7472aa51bb80ce629a9935b4db9eeadf735efaf30899ef73f776a58
HEAD_REF master
PATCHES
000-fix-deps.patch
)

vcpkg_cmake_configure(
Expand Down
1 change: 1 addition & 0 deletions ports/trantor/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -8222,7 +8222,7 @@
},
"trantor": {
"baseline": "1.5.11",
"port-version": 0
"port-version": 1
},
"tre": {
"baseline": "0.8.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/t-/trantor.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "4ac910f7ba58f9ee8ceff1c8ac1d2dfa0200136f",
"version-semver": "1.5.11",
"port-version": 1
},
{
"git-tree": "bdeefc43943ee1bd39f5c46db28a89b01e446b8f",
"version-semver": "1.5.11",
Expand Down

0 comments on commit ebf90b9

Please sign in to comment.