mirror of
https://github.com/libgit2/libgit2.git
synced 2026-06-21 22:16:24 +00:00
deps: make pcre2 the bundled regular expression engine
This commit is contained in:
@@ -56,9 +56,9 @@ elseif(USE_REGEX STREQUAL "builtin")
|
||||
add_feature_info("Regular expressions" ON "using bundled implementation")
|
||||
set(GIT_REGEX_BUILTIN 1)
|
||||
|
||||
add_subdirectory("${PROJECT_SOURCE_DIR}/deps/pcre" "${PROJECT_BINARY_DIR}/deps/pcre")
|
||||
list(APPEND LIBGIT2_DEPENDENCY_INCLUDES "${PROJECT_SOURCE_DIR}/deps/pcre")
|
||||
list(APPEND LIBGIT2_DEPENDENCY_OBJECTS $<TARGET_OBJECTS:pcre>)
|
||||
add_subdirectory("${PROJECT_SOURCE_DIR}/deps/pcre2" "${PROJECT_BINARY_DIR}/deps/pcre2")
|
||||
list(APPEND LIBGIT2_DEPENDENCY_INCLUDES "${PROJECT_SOURCE_DIR}/deps/pcre2")
|
||||
list(APPEND LIBGIT2_DEPENDENCY_OBJECTS $<TARGET_OBJECTS:pcre2>)
|
||||
else()
|
||||
message(FATAL_ERROR "unknown setting to ${OPTION_NAME}: ${USE_REGEX}")
|
||||
endif()
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "regexp.h"
|
||||
|
||||
#if defined(GIT_REGEX_BUILTIN) || defined(GIT_REGEX_PCRE)
|
||||
#if defined(GIT_REGEX_PCRE)
|
||||
|
||||
int git_regexp_compile(git_regexp *r, const char *pattern, int flags)
|
||||
{
|
||||
@@ -73,7 +73,7 @@ out:
|
||||
return 0;
|
||||
}
|
||||
|
||||
#elif defined(GIT_REGEX_PCRE2)
|
||||
#elif defined(GIT_REGEX_BUILTIN) || defined(GIT_REGEX_PCRE2)
|
||||
|
||||
int git_regexp_compile(git_regexp *r, const char *pattern, int flags)
|
||||
{
|
||||
|
||||
@@ -10,8 +10,13 @@
|
||||
|
||||
#include "git2_util.h"
|
||||
|
||||
#if defined(GIT_REGEX_BUILTIN) || defined(GIT_REGEX_PCRE)
|
||||
# include "pcre.h"
|
||||
#if defined(GIT_REGEX_BUILTIN)
|
||||
# define PCRE2_CODE_UNIT_WIDTH 8
|
||||
# include "pcre2.h"
|
||||
typedef pcre2_code *git_regexp;
|
||||
# define GIT_REGEX_INIT NULL
|
||||
#elif defined(GIT_REGEX_PCRE)
|
||||
# include <pcre.h>
|
||||
typedef pcre *git_regexp;
|
||||
# define GIT_REGEX_INIT NULL
|
||||
#elif defined(GIT_REGEX_PCRE2)
|
||||
|
||||
Reference in New Issue
Block a user