Use PCRE as built-in regex library

Replace the use of Henry Spencer's regex library with PCRE at the build
level and enable wxUSE_PCRE in wxRegEx code to switch to PCRE-based
implementation there.

Note that this has to be done unconditionally because there is no simple
way to select between the previously used regex library and PCRE at the
makefiles level.

We could still keep the possibility to use the system regex library
under Unix, but this doesn't seem to be worth doing, as we don't support
Unicode REs properly when using it (and never did), so drop support for
this too.
This commit is contained in:
Vadim Zeitlin
2021-07-17 14:23:23 +02:00
parent 966e9cefb5
commit 3d8438619d
61 changed files with 2464 additions and 1556 deletions

View File

@@ -10,12 +10,36 @@
if(wxUSE_REGEX)
set(wxUSE_REGEX builtin)
wx_add_builtin_library(wxregex
src/regex/regcomp.c
src/regex/regexec.c
src/regex/regerror.c
src/regex/regfree.c
3rdparty/pcre/src/pcre2_auto_possess.c
3rdparty/pcre/src/pcre2_compile.c
3rdparty/pcre/src/pcre2_config.c
3rdparty/pcre/src/pcre2_context.c
3rdparty/pcre/src/pcre2_convert.c
3rdparty/pcre/src/pcre2_dfa_match.c
3rdparty/pcre/src/pcre2_error.c
3rdparty/pcre/src/pcre2_extuni.c
3rdparty/pcre/src/pcre2_find_bracket.c
3rdparty/pcre/src/pcre2_jit_compile.c
3rdparty/pcre/src/pcre2_maketables.c
3rdparty/pcre/src/pcre2_match.c
3rdparty/pcre/src/pcre2_match_data.c
3rdparty/pcre/src/pcre2_newline.c
3rdparty/pcre/src/pcre2_ord2utf.c
3rdparty/pcre/src/pcre2_pattern_info.c
3rdparty/pcre/src/pcre2_script_run.c
3rdparty/pcre/src/pcre2_serialize.c
3rdparty/pcre/src/pcre2_string_utils.c
3rdparty/pcre/src/pcre2_study.c
3rdparty/pcre/src/pcre2_substitute.c
3rdparty/pcre/src/pcre2_substring.c
3rdparty/pcre/src/pcre2_tables.c
3rdparty/pcre/src/pcre2_ucd.c
3rdparty/pcre/src/pcre2_valid_utf.c
3rdparty/pcre/src/pcre2_xclass.c
3rdparty/pcre/src/pcre2_chartables.c
)
target_include_directories(wxregex PRIVATE ${wxSETUP_HEADER_PATH} ${wxSOURCE_DIR}/include)
set(REGEX_LIBRARIES wxregex)
set(REGEX_INCLUDE_DIRS ${wxSOURCE_DIR}/src/regex)
set(REGEX_INCLUDE_DIRS ${wxSOURCE_DIR}/3rdparty/pcre/src/wx)
target_compile_definitions(wxregex PRIVATE __WX__ HAVE_CONFIG_H)
target_include_directories(wxregex PRIVATE ${wxSETUP_HEADER_PATH} ${wxSOURCE_DIR}/include ${REGEX_INCLUDE_DIRS})
endif()