mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-19 04:43:02 +08:00
[hiredis] fix examples (#31130)
This commit is contained in:
parent
a5d91f7d26
commit
845b32161f
@ -2,33 +2,26 @@ diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
|
||||
index dd3a313..8c69d3a 100644
|
||||
--- a/examples/CMakeLists.txt
|
||||
+++ b/examples/CMakeLists.txt
|
||||
@@ -19,16 +19,25 @@ if (LIBEV)
|
||||
@@ -19,16 +19,16 @@ if (LIBEV)
|
||||
TARGET_LINK_LIBRARIES(example-libev hiredis ev)
|
||||
ENDIF()
|
||||
|
||||
-FIND_PATH(LIBEVENT event.h)
|
||||
-if (LIBEVENT)
|
||||
+FIND_PACKAGE(Libevent CONFIG REQUIRED)
|
||||
+FIND_PATH(LIBEVENT_INCLUDES evutil.h)
|
||||
+if (UNIX)
|
||||
+find_package(Libevent CONFIG REQUIRED)
|
||||
+if (1)
|
||||
ADD_EXECUTABLE(example-libevent example-libevent)
|
||||
- TARGET_LINK_LIBRARIES(example-libevent hiredis event)
|
||||
+ TARGET_LINK_LIBRARIES(example-libevent hiredis ${LIBEVENT_LIBRARIES})
|
||||
+ TARGET_INCLUDE_DIRECTORIES(example-libevent PRIVATE ${LIBEVENT_INCLUDES})
|
||||
+ TARGET_LINK_LIBRARIES(example-libevent hiredis libevent::core)
|
||||
ENDIF()
|
||||
|
||||
+FIND_LIBRARY(UV_LIBRARY libuv)
|
||||
FIND_PATH(LIBUV uv.h)
|
||||
IF (LIBUV)
|
||||
-FIND_PATH(LIBUV uv.h)
|
||||
-IF (LIBUV)
|
||||
+find_package(libuv CONFIG REQUIRED)
|
||||
+IF (1)
|
||||
ADD_EXECUTABLE(example-libuv example-libuv.c)
|
||||
- TARGET_LINK_LIBRARIES(example-libuv hiredis uv)
|
||||
+ if(WIN32)
|
||||
+ set(LIB_LISTS Iphlpapi.lib Psapi.lib Userenv.lib)
|
||||
+ else()
|
||||
+ set(LIB_LISTS)
|
||||
+ endif()
|
||||
+ TARGET_LINK_LIBRARIES(example-libuv hiredis ${UV_LIBRARY} ${LIB_LISTS})
|
||||
+ TARGET_INCLUDE_DIRECTORIES(example-libuv PRIVATE ${LIBUV})
|
||||
+ TARGET_LINK_LIBRARIES(example-libuv hiredis $<IF:$<TARGET_EXISTS:uv_a>,uv_a,uv>)
|
||||
ENDIF()
|
||||
|
||||
IF (APPLE)
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "hiredis",
|
||||
"version": "1.0.2",
|
||||
"port-version": 4,
|
||||
"port-version": 5,
|
||||
"description": "Hiredis is a minimalistic C client library for the Redis database.",
|
||||
"homepage": "https://github.com/redis/hiredis",
|
||||
"license": "BSD-3-Clause",
|
||||
|
@ -3118,7 +3118,7 @@
|
||||
},
|
||||
"hiredis": {
|
||||
"baseline": "1.0.2",
|
||||
"port-version": 4
|
||||
"port-version": 5
|
||||
},
|
||||
"hnswlib": {
|
||||
"baseline": "0.7.0",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "413b1dbea0dd87e4a12a646ba12411d319e5bf38",
|
||||
"version": "1.0.2",
|
||||
"port-version": 5
|
||||
},
|
||||
{
|
||||
"git-tree": "448374fa990c04aa7964508d32817a6d7868600b",
|
||||
"version": "1.0.2",
|
||||
|
Loading…
Reference in New Issue
Block a user