Files
MINGW-packages/mingw-w64-libgit2/0002-cmake-fix-openssl-build-on-win32.patch
Christoph Reiter f2acd2c5d7 libgit2: Update to 1.7.1
https backend options have been renamed.
fix openssl build due to missing library
2023-08-19 10:54:56 +02:00

60 lines
2.2 KiB
Diff

From 86872834c5fc40b78e4881255fad5b11bc866fd4 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Sat, 19 Aug 2023 10:44:25 +0200
Subject: [PATCH] cmake: fix openssl build on win32
since f15c8ac71a916b libgit unconditionally depends on secur32 on Windows
but only added it in cmake for the winhttp and schannel variants.
In case libgit is built against openssl it would fail to link.
This moves secur32 out of the https backend selection code into
the global win32 condition (and while at it also adds ws2_32 to the .pc file)
---
cmake/SelectHTTPSBackend.cmake | 8 ++++----
src/CMakeLists.txt | 3 ++-
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/cmake/SelectHTTPSBackend.cmake b/cmake/SelectHTTPSBackend.cmake
index d14941643..0b3d63a79 100644
--- a/cmake/SelectHTTPSBackend.cmake
+++ b/cmake/SelectHTTPSBackend.cmake
@@ -109,8 +109,8 @@ if(USE_HTTPS)
elseif(USE_HTTPS STREQUAL "Schannel")
set(GIT_SCHANNEL 1)
- list(APPEND LIBGIT2_SYSTEM_LIBS "rpcrt4" "crypt32" "ole32" "secur32")
- list(APPEND LIBGIT2_PC_LIBS "-lrpcrt4" "-lcrypt32" "-lole32" "-lsecur32")
+ list(APPEND LIBGIT2_SYSTEM_LIBS "rpcrt4" "crypt32" "ole32")
+ list(APPEND LIBGIT2_PC_LIBS "-lrpcrt4" "-lcrypt32" "-lole32")
elseif(USE_HTTPS STREQUAL "WinHTTP")
set(GIT_WINHTTP 1)
@@ -125,8 +125,8 @@ if(USE_HTTPS)
list(APPEND LIBGIT2_PC_LIBS "-lwinhttp")
endif()
- list(APPEND LIBGIT2_SYSTEM_LIBS "rpcrt4" "crypt32" "ole32" "secur32")
- list(APPEND LIBGIT2_PC_LIBS "-lrpcrt4" "-lcrypt32" "-lole32" "-lsecur32")
+ list(APPEND LIBGIT2_SYSTEM_LIBS "rpcrt4" "crypt32" "ole32")
+ list(APPEND LIBGIT2_PC_LIBS "-lrpcrt4" "-lcrypt32" "-lole32")
elseif(USE_HTTPS STREQUAL "OpenSSL-Dynamic")
set(GIT_OPENSSL 1)
set(GIT_OPENSSL_DYNAMIC 1)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 8525acdd8..b412452c9 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -135,7 +135,8 @@ endif()
# platform libraries
if(WIN32)
- list(APPEND LIBGIT2_SYSTEM_LIBS ws2_32)
+ list(APPEND LIBGIT2_SYSTEM_LIBS "ws2_32" "secur32")
+ list(APPEND LIBGIT2_PC_LIBS "-lws2_32" "-lsecur32")
endif()
if(CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
--
2.41.0