This file is part of MXE. See LICENSE.md for licensing information.

Contains ad hoc patches for cross building.

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tomas Kalibera <tomas.kalibera@gmail.com>
Date: Thu, 19 May 2022 09:21:45 -0400
Subject: [PATCH 1/1] Fixes for static linking.


diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1111111..2222222 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,6 +5,7 @@ PROJECT(hiredis)
 OPTION(ENABLE_SSL "Build hiredis_ssl for SSL support" OFF)
 OPTION(DISABLE_TESTS "If tests should be compiled or not" OFF)
 OPTION(ENABLE_SSL_TESTS, "Should we test SSL connections" OFF)
+OPTION(BUILD_SHARED_LIBS "Build hiredis as a shared library" ON)
 
 MACRO(getVersionBit name)
   SET(VERSION_REGEX "^#define ${name} (.+)$")
@@ -40,7 +41,7 @@ IF(WIN32)
     ADD_COMPILE_DEFINITIONS(_CRT_SECURE_NO_WARNINGS WIN32_LEAN_AND_MEAN)
 ENDIF()
 
-ADD_LIBRARY(hiredis SHARED ${hiredis_sources})
+ADD_LIBRARY(hiredis ${hiredis_sources})
 
 SET_TARGET_PROPERTIES(hiredis
     PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE
@@ -97,7 +98,7 @@ IF(ENABLE_SSL)
     FIND_PACKAGE(OpenSSL REQUIRED)
     SET(hiredis_ssl_sources 
         ssl.c)
-    ADD_LIBRARY(hiredis_ssl SHARED
+    ADD_LIBRARY(hiredis_ssl
             ${hiredis_ssl_sources})
 
     IF (APPLE)
diff --git a/hiredis.pc.in b/hiredis.pc.in
index 1111111..2222222 100644
--- a/hiredis.pc.in
+++ b/hiredis.pc.in
@@ -8,5 +8,5 @@ pkgincludedir=${includedir}/hiredis
 Name: hiredis
 Description: Minimalistic C client library for Redis.
 Version: @PROJECT_VERSION@
-Libs: -L${libdir} -lhiredis
+Libs: -L${libdir} -lhiredis -lws2_32 -lcrypt32
 Cflags: -I${pkgincludedir} -D_FILE_OFFSET_BITS=64
diff --git a/hiredis_ssl.pc.in b/hiredis_ssl.pc.in
index 1111111..2222222 100644
--- a/hiredis_ssl.pc.in
+++ b/hiredis_ssl.pc.in
@@ -8,5 +8,5 @@ Name: hiredis_ssl
 Description: SSL Support for hiredis.
 Version: @PROJECT_VERSION@
 Requires: hiredis
-Libs: -L${libdir} -lhiredis_ssl
+Libs: -L${libdir} -lhiredis_ssl -lws2_32 -lcrypt32
 Libs.private: -lssl -lcrypto
