mirror of
https://gitee.com/openharmony/third_party_rust_regex
synced 2025-04-11 23:18:23 +00:00

Neither of them were particularly competitive and they make building the benchmark harness more trouble than it's worth.
21 lines
693 B
Rust
21 lines
693 B
Rust
use std::env;
|
|
|
|
fn main() {
|
|
if env::var("CARGO_FEATURE_RE_PCRE2").is_ok() {
|
|
pkg_config::probe_library("libpcre2-8").unwrap();
|
|
}
|
|
if env::var("CARGO_FEATURE_RE_RE2").is_ok() {
|
|
// RE2 is a C++ library, so we need to compile our shim layer.
|
|
cc::Build::new()
|
|
.cpp(true)
|
|
.file("src/ffi/re2.cpp")
|
|
.compile("libcre2.a");
|
|
// It's important this comes after compiling the shim, which results
|
|
// in the correct order of arguments given to the linker.
|
|
pkg_config::probe_library("re2").unwrap();
|
|
}
|
|
if env::var("CARGO_FEATURE_RE_TCL").is_ok() {
|
|
pkg_config::probe_library("tcl").unwrap();
|
|
}
|
|
}
|