Commit 83fa5480 by Edward Thomson

cmake: refactor WinHTTP selection

Move WinHTTP selection into its own cmake module.
parent e35a22a0
if(WIN32 AND WINHTTP)
set(GIT_WINHTTP 1)
# Since MinGW does not come with headers or an import library for winhttp,
# we have to include a private header and generate our own import library
if(MINGW)
add_subdirectory("${libgit2_SOURCE_DIR}/deps/winhttp" "${libgit2_BINARY_DIR}/deps/winhttp")
list(APPEND LIBGIT2_LIBS winhttp)
list(APPEND LIBGIT2_DEPENDENCY_INCLUDES "${libgit2_SOURCE_DIR}/deps/winhttp")
else()
list(APPEND LIBGIT2_LIBS "winhttp")
list(APPEND LIBGIT2_PC_LIBS "-lwinhttp")
endif()
list(APPEND LIBGIT2_LIBS "rpcrt4" "crypt32" "ole32")
list(APPEND LIBGIT2_PC_LIBS "-lrpcrt4" "-lcrypt32" "-lole32")
endif()
...@@ -93,29 +93,12 @@ if(WIN32 AND EMBED_SSH_PATH) ...@@ -93,29 +93,12 @@ if(WIN32 AND EMBED_SSH_PATH)
set(GIT_SSH 1) set(GIT_SSH 1)
endif() endif()
if(WIN32 AND USE_WINHTTP)
set(GIT_WINHTTP 1)
# Since MinGW does not come with headers or an import library for winhttp,
# we have to include a private header and generate our own import library
if(MINGW)
add_subdirectory("${libgit2_SOURCE_DIR}/deps/winhttp" "${libgit2_BINARY_DIR}/deps/winhttp")
list(APPEND LIBGIT2_LIBS winhttp)
list(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/winhttp")
else()
list(APPEND LIBGIT2_LIBS "winhttp")
list(APPEND LIBGIT2_PC_LIBS "-lwinhttp")
endif()
list(APPEND LIBGIT2_LIBS "rpcrt4" "crypt32" "ole32")
list(APPEND LIBGIT2_PC_LIBS "-lrpcrt4" "-lcrypt32" "-lole32")
endif()
include(SelectHTTPSBackend) include(SelectHTTPSBackend)
include(SelectHashes) include(SelectHashes)
include(SelectHTTPParser) include(SelectHTTPParser)
include(SelectRegex) include(SelectRegex)
include(SelectSSH) include(SelectSSH)
include(SelectWinHTTP)
target_sources(git2internal PRIVATE ${SRC_SHA1}) target_sources(git2internal PRIVATE ${SRC_SHA1})
......
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