mirror of
https://github.com/libgit2/libgit2.git
synced 2026-01-25 02:56:17 +00:00
http: make llhttp the default
This commit is contained in:
@@ -24,9 +24,9 @@ elseif(USE_HTTP_PARSER STREQUAL "llhttp")
|
||||
message(FATAL_ERROR "llhttp support was requested but not found")
|
||||
endif()
|
||||
else()
|
||||
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 "$<TARGET_OBJECTS:http-parser>")
|
||||
add_subdirectory("${PROJECT_SOURCE_DIR}/deps/llhttp" "${PROJECT_BINARY_DIR}/deps/llhttp")
|
||||
list(APPEND LIBGIT2_DEPENDENCY_INCLUDES "${PROJECT_SOURCE_DIR}/deps/llhttp")
|
||||
list(APPEND LIBGIT2_DEPENDENCY_OBJECTS "$<TARGET_OBJECTS:llhttp>")
|
||||
set(GIT_HTTPPARSER_BUILTIN 1)
|
||||
add_feature_info(http-parser ON "using bundled parser")
|
||||
endif()
|
||||
|
||||
6
deps/llhttp/CMakeLists.txt
vendored
6
deps/llhttp/CMakeLists.txt
vendored
@@ -1,7 +1,7 @@
|
||||
file(GLOB SRC_HTTP "*.c" "*.h")
|
||||
list(SORT SRC_HTTP)
|
||||
file(GLOB SRC_LLHTTP "*.c" "*.h")
|
||||
list(SORT SRC_LLHTTP)
|
||||
|
||||
add_library(llhttp OBJECT ${SRC_HTTP})
|
||||
add_library(llhttp OBJECT ${SRC_LLHTTP})
|
||||
|
||||
if(NOT MSVC)
|
||||
set_source_files_properties(api.c http.c llhttp.c PROPERTIES COMPILE_FLAGS "-Wno-unused-parameter -Wno-missing-declarations")
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#if defined(GIT_HTTPPARSER_HTTPPARSER) || defined(GIT_HTTPPARSER_BUILTIN)
|
||||
#if defined(GIT_HTTPPARSER_HTTPPARSER)
|
||||
|
||||
#include "http_parser.h"
|
||||
|
||||
@@ -82,7 +82,7 @@ size_t git_http_parser_execute(
|
||||
return http_parser_execute(&parser->parser, &settings_proxy, data, len);
|
||||
}
|
||||
|
||||
#elif defined(GIT_HTTPPARSER_LLHTTP)
|
||||
#elif defined(GIT_HTTPPARSER_LLHTTP) || defined(GIT_HTTPPARSER_BUILTIN)
|
||||
|
||||
# include <llhttp.h>
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include "git2_util.h"
|
||||
|
||||
#if defined(GIT_HTTPPARSER_HTTPPARSER) || defined(GIT_HTTPPARSER_BUILTIN)
|
||||
#if defined(GIT_HTTPPARSER_HTTPPARSER)
|
||||
|
||||
# include <http_parser.h>
|
||||
|
||||
@@ -60,7 +60,7 @@ size_t git_http_parser_execute(
|
||||
# define git_http_parser_errno(parser) parser->parser.http_errno
|
||||
# define git_http_parser_errmsg(parser, errno) http_errno_description(errno)
|
||||
|
||||
#elif defined(GIT_HTTPPARSER_LLHTTP)
|
||||
#elif defined(GIT_HTTPPARSER_LLHTTP) || defined(GIT_HTTPPARSER_BUILTIN)
|
||||
|
||||
# include <llhttp.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user