Skip to content

Commit 6f02a4d

Browse files
authored
Merge pull request libgit2#4278 from pks-t/pks/cmake-disable-http-parser
cmake: Permit disabling external http-parser
2 parents fa94875 + 845f661 commit 6f02a4d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ OPTION( USE_SSH "Link with libssh to enable SSH support" ON )
4343
OPTION( USE_GSSAPI "Link with libgssapi for SPNEGO auth" OFF )
4444
OPTION( VALGRIND "Configure build for valgrind" OFF )
4545
OPTION( CURL "Use curl for HTTP if available" ON)
46+
OPTION( USE_EXT_HTTP_PARSER "Use system HTTP_Parser if available" ON)
4647
OPTION( DEBUG_POOL "Enable debug pool allocator" OFF )
4748

4849
IF(DEBUG_POOL)
@@ -329,12 +330,12 @@ ENDIF()
329330

330331
# Optional external dependency: http-parser
331332
FIND_PACKAGE(HTTP_Parser)
332-
IF (HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2)
333+
IF (USE_EXT_HTTP_PARSER AND HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2)
333334
INCLUDE_DIRECTORIES(${HTTP_PARSER_INCLUDE_DIRS})
334335
LINK_LIBRARIES(${HTTP_PARSER_LIBRARIES})
335336
LIST(APPEND LIBGIT2_PC_LIBS "-lhttp_parser")
336337
ELSE()
337-
MESSAGE(STATUS "http-parser version 2 was not found; using bundled 3rd-party sources.")
338+
MESSAGE(STATUS "http-parser version 2 was not found or disabled; using bundled 3rd-party sources.")
338339
INCLUDE_DIRECTORIES(deps/http-parser)
339340
FILE(GLOB SRC_HTTP deps/http-parser/*.c deps/http-parser/*.h)
340341
ENDIF()

0 commit comments

Comments
 (0)