diff options
author | Elliot Saba <staticfloat@gmail.com> | 2016-11-20 22:46:01 -0800 |
---|---|---|
committer | Elliot Saba <staticfloat@gmail.com> | 2016-11-20 22:46:01 -0800 |
commit | 236a690ce4cbcbaf243dda8853832de8485bac3f (patch) | |
tree | 676a535f6d3fd3826e70356797994b35b1014c07 | |
parent | ae5838f118a4819e608990a815bf8fc482be5772 (diff) | |
download | libgit2-236a690ce4cbcbaf243dda8853832de8485bac3f.tar.gz |
Allow Windows with WinHTTP to use external http-parser
-rw-r--r-- | CMakeLists.txt | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f26f46879..8cc43c6ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -235,10 +235,21 @@ IF (WIN32 AND EMBED_SSH_PATH) ADD_DEFINITIONS(-DGIT_SSH) ENDIF() -IF (WIN32 AND WINHTTP) - ADD_DEFINITIONS(-DGIT_WINHTTP) + +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() + + +IF (WIN32 AND WINHTTP) + ADD_DEFINITIONS(-DGIT_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 @@ -291,17 +302,6 @@ ELSE () LINK_LIBRARIES(${CURL_LIBRARIES}) LIST(APPEND LIBGIT2_PC_LIBS ${CURL_LDFLAGS}) 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() # Specify sha1 implementation |