From 29b5ab554790bb57337a3b6ab9dcd963cf69d22e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 14:47:08 +0200 Subject: Adding upstream version 1.7.2+ds. Signed-off-by: Daniel Baumann --- cmake/SelectHTTPParser.cmake | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 cmake/SelectHTTPParser.cmake (limited to 'cmake/SelectHTTPParser.cmake') diff --git a/cmake/SelectHTTPParser.cmake b/cmake/SelectHTTPParser.cmake new file mode 100644 index 0000000..955aea3 --- /dev/null +++ b/cmake/SelectHTTPParser.cmake @@ -0,0 +1,19 @@ +# Optional external dependency: http-parser +if(USE_HTTP_PARSER STREQUAL "system") + find_package(HTTPParser) + + if(HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2) + list(APPEND LIBGIT2_SYSTEM_INCLUDES ${HTTP_PARSER_INCLUDE_DIRS}) + list(APPEND LIBGIT2_SYSTEM_LIBS ${HTTP_PARSER_LIBRARIES}) + list(APPEND LIBGIT2_PC_LIBS "-lhttp_parser") + add_feature_info(http-parser ON "http-parser support (system)") + else() + message(FATAL_ERROR "http-parser support was requested but not found") + endif() +else() + message(STATUS "http-parser version 2 was not found or disabled; using bundled 3rd-party sources.") + add_subdirectory("${PROJECT_SOURCE_DIR}/deps/http-parser" "${PROJECT_BINARY_DIR}/deps/http-parser") + list(APPEND LIBGIT2_DEPENDENCY_INCLUDES "${PROJECT_SOURCE_DIR}/deps/http-parser") + list(APPEND LIBGIT2_DEPENDENCY_OBJECTS "$") + add_feature_info(http-parser ON "http-parser support (bundled)") +endif() -- cgit v1.2.3