Repository navigation
cmake: add an opt-in system PCRE2 mode - #735
Open
stevegrubb wants to merge 3 commits into
Open
stevegrubb wants to merge 3 commits into
stevegrubb wants to merge 3 commits into
Conversation
OpenVINO Tokenizers always declares and populates its pinned PCRE2 source through FetchContent. This prevents network-free system-package builds and can put a second PCRE2 implementation into a process that already uses the system library. Add a default-off ENABLE_SYSTEM_PCRE2 option. When enabled, use pkg-config's libpcre2-8 module and link its imported target. Report actionable errors when pkg-config or the PCRE2 development metadata is unavailable. Define the target at project scope so every Tokenizers subdirectory can use it without exposing a GLOBAL target to embedding projects. With the option off, retain the existing pinned FetchContent behavior. Both paths continue to use 8-bit PCRE2 code units. Co-authored-by: Artur Paniukov <chgk1101@gmail.com>
apaniukov
reviewed
Aug 27, 2026
|
|
||
| # Define the imported target here so every Tokenizers subdirectory can | ||
| # use it without leaking a GLOBAL target into an embedding project. | ||
| pkg_check_modules(PCRE2 QUIET IMPORTED_TARGET libpcre2-8) |
Collaborator
There was a problem hiding this comment.
Could we use a project-specific pkg-config prefix here, such as OV_TOKENIZERS_PCRE2? When this project is included through add_subdirectory(), a parent may already define the generic PkgConfig::PCRE2 target.
Collaborator
|
build_jenkins |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpenVINO Tokenizers always declares and populates its pinned PCRE2 source through FetchContent. This prevents network-free system-package builds and can put a second PCRE2 implementation into a process that already uses the system library.
Add a default-off ENABLE_SYSTEM_PCRE2 option. When enabled, use pkg-config's libpcre2-8 module and link its imported target. Report actionable errors when pkg-config or the PCRE2 development metadata is unavailable. Define the target at project scope so every Tokenizers subdirectory can use it without exposing a GLOBAL target to embedding projects. With the option off, retain the existing pinned FetchContent behavior. Both paths continue to use 8-bit PCRE2 code units.