mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-21 20:14:44 +00:00
Merge pull request #4015 from staticfloat/sf/win_http_parser
Allow Windows with WinHTTP to use external http-parser
This commit is contained in:
commit
805b90aac4
@ -237,8 +237,6 @@ ENDIF()
|
|||||||
|
|
||||||
IF (WIN32 AND WINHTTP)
|
IF (WIN32 AND WINHTTP)
|
||||||
ADD_DEFINITIONS(-DGIT_WINHTTP)
|
ADD_DEFINITIONS(-DGIT_WINHTTP)
|
||||||
INCLUDE_DIRECTORIES(deps/http-parser)
|
|
||||||
FILE(GLOB SRC_HTTP deps/http-parser/*.c deps/http-parser/*.h)
|
|
||||||
|
|
||||||
# Since MinGW does not come with headers or an import library for winhttp,
|
# 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
|
# we have to include a private header and generate our own import library
|
||||||
@ -291,17 +289,6 @@ ELSE ()
|
|||||||
LINK_LIBRARIES(${CURL_LIBRARIES})
|
LINK_LIBRARIES(${CURL_LIBRARIES})
|
||||||
LIST(APPEND LIBGIT2_PC_LIBS ${CURL_LDFLAGS})
|
LIST(APPEND LIBGIT2_PC_LIBS ${CURL_LDFLAGS})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
FIND_PACKAGE(HTTP_Parser)
|
|
||||||
IF (HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2)
|
|
||||||
INCLUDE_DIRECTORIES(${HTTP_PARSER_INCLUDE_DIRS})
|
|
||||||
LINK_LIBRARIES(${HTTP_PARSER_LIBRARIES})
|
|
||||||
LIST(APPEND LIBGIT2_PC_LIBS "-lhttp_parser")
|
|
||||||
ELSE()
|
|
||||||
MESSAGE(STATUS "http-parser was not found or is too old; using bundled 3rd-party sources.")
|
|
||||||
INCLUDE_DIRECTORIES(deps/http-parser)
|
|
||||||
FILE(GLOB SRC_HTTP deps/http-parser/*.c deps/http-parser/*.h)
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# Specify sha1 implementation
|
# Specify sha1 implementation
|
||||||
@ -332,6 +319,18 @@ IF(WIN32 OR AMIGA OR CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
|
|||||||
SET(SRC_REGEX deps/regex/regex.c)
|
SET(SRC_REGEX deps/regex/regex.c)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
# Optional external dependency: http-parser
|
||||||
|
FIND_PACKAGE(HTTP_Parser)
|
||||||
|
IF (HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2)
|
||||||
|
INCLUDE_DIRECTORIES(${HTTP_PARSER_INCLUDE_DIRS})
|
||||||
|
LINK_LIBRARIES(${HTTP_PARSER_LIBRARIES})
|
||||||
|
LIST(APPEND LIBGIT2_PC_LIBS "-lhttp_parser")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS "http-parser version 2 was not found; using bundled 3rd-party sources.")
|
||||||
|
INCLUDE_DIRECTORIES(deps/http-parser)
|
||||||
|
FILE(GLOB SRC_HTTP deps/http-parser/*.c deps/http-parser/*.h)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
# Optional external dependency: zlib
|
# Optional external dependency: zlib
|
||||||
FIND_PACKAGE(ZLIB)
|
FIND_PACKAGE(ZLIB)
|
||||||
IF (ZLIB_FOUND)
|
IF (ZLIB_FOUND)
|
||||||
|
Loading…
Reference in New Issue
Block a user