• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 use std::env;
2 
main()3 fn main() {
4     if env::var("CARGO_FEATURE_RE_PCRE2").is_ok() {
5         pkg_config::probe_library("libpcre2-8").unwrap();
6     }
7     if env::var("CARGO_FEATURE_RE_RE2").is_ok() {
8         // RE2 is a C++ library, so we need to compile our shim layer.
9         cc::Build::new()
10             .cpp(true)
11             .file("src/ffi/re2.cpp")
12             .compile("libcre2.a");
13         // It's important this comes after compiling the shim, which results
14         // in the correct order of arguments given to the linker.
15         pkg_config::probe_library("re2").unwrap();
16     }
17     if env::var("CARGO_FEATURE_RE_TCL").is_ok() {
18         pkg_config::probe_library("tcl").unwrap();
19     }
20 }
21