Commit 86872834 by Christoph Reiter

cmake: fix openssl build on win32

since f15c8ac7 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)
parent 8ffdc5a9
......@@ -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)
......
......@@ -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)")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment