8000 cmake: fix openssl build on win32 · libgit2/libgit2@8687283 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8687283

Browse files
committed
cmake: fix openssl build on win32
since f15c8ac 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)
1 parent 8ffdc5a commit 8687283

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

cmake/SelectHTTPSBackend.cmake

+4-4
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ if(USE_HTTPS)
109109
elseif(USE_HTTPS STREQUAL "Schannel")
110110
set(GIT_SCHANNEL 1)
111111

112-
list(APPEND LIBGIT2_SYSTEM_LIBS "rpcrt4" "crypt32" "ole32" "secur32")
113-
list(APPEND LIBGIT2_PC_LIBS "-lrpcrt4" "-lcrypt32" "-lole32" "-lsecur32")
112+
list(APPEND LIBGIT2_SYSTEM_LIBS "rpcrt4" "crypt32" "ole32")
113+
list(APPEND LIBGIT2_PC_LIBS "-lrpcrt4" "-lcrypt32" "-lole32")
114114
elseif(USE_HTTPS STREQUAL "WinHTTP")
115115
set(GIT_WINHTTP 1)
116116

@@ -125,8 +125,8 @@ if(USE_HTTPS)
125125
list(APPEND LIBGIT2_PC_LIBS "-lwinhttp")
126126
endif()
127127

128-
list(APPEND LIBGIT2_SYSTEM_LIBS "rpcrt4" "crypt32" "ole32" "secur32")
129-
list(APPEND LIBGIT2_PC_LIBS "-lrpcrt4" "-lcrypt32" "-lole32" "-lsecur32")
128+
list(APPEND LIBGIT2_SYSTEM_LIBS "rpcrt4" "crypt32" "ole32")
129+
list(APPEND LIBGIT2_PC_LIBS "-lrpcrt4" "-lcrypt32" "-lole32")
130130
elseif(USE_HTTPS STREQUAL "OpenSSL-Dynamic")
131131
set(GIT_OPENSSL 1)
132132
set(GIT_OPENSSL_DYNAMIC 1)

src/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ endif()
135135
# platform libraries
136136

137137
if(WIN32)
138-
list(APPEND LIBGIT2_SYSTEM_LIBS ws2_32)
138+
list(APPEND LIBGIT2_SYSTEM_LIBS "ws2_32" "secur32")
139+
list(APPEND LIBGIT2_PC_LIBS "-lws2_32" "-lsecur32")
139140
endif()
140141

141142
if(CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")

0 commit comments

Comments
 (0)
0