aboutsummaryrefslogtreecommitdiff
path: root/ports/hiredis/fix-feature-example.patch
diff options
context:
space:
mode:
authorJack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>2019-12-24 04:18:50 +0800
committerRobert Schumacher <roschuma@microsoft.com>2019-12-23 12:18:50 -0800
commitf3c11016efb9acd4dd2f16f98519bb7b499f5a45 (patch)
treeb7b27a134e97b32f6b8afe3abf7158fc0ad43fa7 /ports/hiredis/fix-feature-example.patch
parentc0d22c88ea7638d1b74339f9e9adfd37b0f525ed (diff)
downloadvcpkg-f3c11016efb9acd4dd2f16f98519bb7b499f5a45.tar.gz
vcpkg-f3c11016efb9acd4dd2f16f98519bb7b499f5a45.zip
[hiredis] Support building static (#9388)
* [hiredis] Support building static * update baseline * update baseline
Diffstat (limited to 'ports/hiredis/fix-feature-example.patch')
-rw-r--r--ports/hiredis/fix-feature-example.patch76
1 files changed, 76 insertions, 0 deletions
diff --git a/ports/hiredis/fix-feature-example.patch b/ports/hiredis/fix-feature-example.patch
new file mode 100644
index 000000000..a61900185
--- /dev/null
+++ b/ports/hiredis/fix-feature-example.patch
@@ -0,0 +1,76 @@
+diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
+index dd3a313..0df75d5 100644
+--- a/examples/CMakeLists.txt
++++ b/examples/CMakeLists.txt
+@@ -19,10 +19,17 @@ 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 (BUILD_SHARED_LIBS)
++ set(LIBEVENT_LIBS ${LIBEVENT_SHARED_LIBRARIES})
++else()
++ set(LIBEVENT_LIBS ${LIBEVENT_STATIC_LIBRARIES})
++endif()
++if (UNIX)
+ ADD_EXECUTABLE(example-libevent example-libevent)
+- TARGET_LINK_LIBRARIES(example-libevent hiredis event)
++ TARGET_LINK_LIBRARIES(example-libevent hiredis ${LIBEVENT_LIBS})
++ TARGET_INCLUDE_DIRECTORIES(example-libevent PRIVATE ${LIBEVENT_INCLUDES})
+ ENDIF()
+
+ FIND_PATH(LIBUV uv.h)
+@@ -38,9 +45,17 @@ IF (APPLE)
+ ENDIF()
+
+ IF (ENABLE_SSL)
++ FIND_PACKAGE(OpenSSL REQUIRED)
++ IF (WIN32)
++ FIND_PACKAGE(pthreads REQUIRED)
++ SET(THREADS_LIBS PThreads4W::PThreads4W)
++ ELSE()
++ FIND_PACKAGE(Threads)
++ SET(THREADS_LIBS ${CMAKE_THREAD_LIBS_INIT})
++ ENDIF()
+ ADD_EXECUTABLE(example-ssl example-ssl.c)
+- TARGET_LINK_LIBRARIES(example-ssl hiredis hiredis_ssl)
++ TARGET_LINK_LIBRARIES(example-ssl hiredis hiredis_ssl OpenSSL::SSL OpenSSL::Crypto ${THREADS_LIBS})
+ ENDIF()
+
+ ADD_EXECUTABLE(example example.c)
+-TARGET_LINK_LIBRARIES(example hiredis)
++TARGET_LINK_LIBRARIES(example hiredis ${LIBEVENT_LIBS})
+\ No newline at end of file
+diff --git a/examples/example-ssl.c b/examples/example-ssl.c
+index 81f4648..9f42923 100644
+--- a/examples/example-ssl.c
++++ b/examples/example-ssl.c
+@@ -1,6 +1,10 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#ifdef _WIN32
++#include <Winsock2.h>
++#include <Windows.h>
++#endif
+
+ #include <hiredis.h>
+ #include <hiredis_ssl.h>
+diff --git a/examples/example.c b/examples/example.c
+index 0e93fc8..339e322 100644
+--- a/examples/example.c
++++ b/examples/example.c
+@@ -1,6 +1,10 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#ifdef _WIN32
++#include <Winsock2.h>
++#include <Windows.h>
++#endif
+
+ #include <hiredis.h>
+