Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ option(FLB_SMALL "Optimise for small size" No)
option(FLB_COVERAGE "Build with code-coverage" No)
option(FLB_JEMALLOC "Build with Jemalloc support" No)
option(FLB_REGEX "Build with Regex support" Yes)
option(FLB_REGEX_RUBY "Build with ruby regex capture name support" No)
option(FLB_UTF8_ENCODER "Build with UTF8 encoding support" Yes)
option(FLB_PARSER "Build with Parser support" Yes)
option(FLB_TLS "Build with SSL/TLS support" Yes)
Expand Down Expand Up @@ -959,6 +960,10 @@ if(FLB_REGEX)
add_subdirectory(${FLB_PATH_LIB_ONIGMO} EXCLUDE_FROM_ALL)
endif()

if(FLB_REGEX_RUBY)
option(ONIGMO_RUBY_REGEX_NAMES ON)
endif()

# tutf8e (UTF8 Encoding)
# =====================
if(FLB_UTF8_ENCODER)
Expand Down
1 change: 1 addition & 0 deletions dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ RUN cmake -DFLB_RELEASE=On \
-DFLB_NIGHTLY_BUILD="$FLB_NIGHTLY_BUILD" \
-DFLB_LOG_NO_CONTROL_CHARS=On \
-DFLB_CHUNK_TRACE="$FLB_CHUNK_TRACE" \
-DFLB_REGEX_RUBY=On \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also needs to flow into the package builds and there I would say it needs to be configurable via an ARG:

Once done we also need to ensure this builds for all targets - see the template above to run a local test first then we can label with ok-package-test.

..

RUN make -j "$(getconf _NPROCESSORS_ONLN)"
Expand Down
15 changes: 10 additions & 5 deletions lib/onigmo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@ set(PACKAGE_URL "")
# Build Options
option(USE_COMBINATION_EXPLOSION_CHECK "Enable combination explosion check" No)
option(USE_CRNL_AS_LINE_TERMINATOR "Enable CR+NL as line terminator" No)
option(ONIGMO_SHARED_LIB "Enable to build shared library" Yes)
option(ONIGMO_CTESTS "Enable testing with ctest" Yes)
option(ONIGMO_CTESTS_SAMPLE "Enable testing with ctest on sample" Yes)
option(ONIGMO_PYTHON_TESTS "Enable testing with python tests" Yes)
option(ONIGMO_MACOS_DEFAULTS "Build with predefined macOS settings" Yes)
option(ONIGMO_RUBY_REGEX_NAMES "Enable ruby-like named capture groups" No)
option(ONIGMO_SHARED_LIB "Enable to build shared library" Yes)
option(ONIGMO_CTESTS "Enable testing with ctest" Yes)
option(ONIGMO_CTESTS_SAMPLE "Enable testing with ctest on sample" Yes)
option(ONIGMO_PYTHON_TESTS "Enable testing with python tests" Yes)
option(ONIGMO_MACOS_DEFAULTS "Build with predefined macOS settings" Yes)

if(USE_COMBINATION_EXPLOSION_CHECK)
add_definitions(-DUSE_COMBINATION_EXPLOSION_CHECK=1)
Expand Down Expand Up @@ -267,6 +268,10 @@ if(ONIGMO_SHARED_LIB)
RUNTIME DESTINATION ${ONIGMO_INSTALL_BINDIR})
endif()

if(ONIGMO_RUBY_REGEX_NAMES)
add_definitions(-DRUBY_CODE_NAME)
endif()

# Test Source

if(ONIGMO_CTESTS)
Expand Down
2 changes: 1 addition & 1 deletion lib/onigmo/regparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -2506,7 +2506,7 @@ get_name_end_code_point(OnigCodePoint start)
}

#ifdef USE_NAMED_GROUP
# ifdef RUBY
# if defined(RUBY) || defined(RUBY_CODE_NAME)
# define ONIGENC_IS_CODE_NAME(enc, c) TRUE
# else
# define ONIGENC_IS_CODE_NAME(enc, c) ONIGENC_IS_CODE_WORD(enc, c)
Expand Down