LibRegex: Hide the Unicode allocator override behind a feature

In a similar fashion to 46912fce8d.

In this case, a future commit will make LibURL depend on
LibRegex's Rust module, so we need to apply the same change here
too.
This commit is contained in:
Shannon Booth 2026-05-17 18:53:49 +02:00 committed by Shannon Booth
parent 079f41b6bb
commit 45dd8d093f
3 changed files with 6 additions and 1 deletions

View file

@ -5,7 +5,7 @@ set(SOURCES
ladybird_lib(LibRegex regex EXPLICIT_SYMBOL_EXPORT)
import_rust_crate(MANIFEST_PATH Rust/Cargo.toml CRATE_NAME libregex_rust FFI_HEADER RustFFI.h)
import_rust_crate(MANIFEST_PATH Rust/Cargo.toml CRATE_NAME libregex_rust FEATURES allocator FFI_HEADER RustFFI.h)
target_link_libraries(LibRegex PRIVATE libregex_rust LibUnicode)
if ((LINUX OR BSD) AND NOT BUILD_SHARED_LIBS)
target_link_options(LibRegex INTERFACE LINKER:--allow-multiple-definition)

View file

@ -11,5 +11,9 @@ crate-type = ["staticlib"]
[dependencies]
libunicode_rust = { path = "../../LibUnicode/Rust", default-features = false }
[features]
default = []
allocator = []
[build-dependencies]
cbindgen = "0.29"

View file

@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#[cfg(feature = "allocator")]
#[path = "../../../RustAllocator.rs"]
mod rust_allocator;