view rust/hg-core/build.rs @ 44353:54d185eb24b5

rust-matchers: implement `visit_children_set` for `FileMatcher` As per the removed inline comment, this will become useful in a future patch in this series as the `IncludeMatcher` is introduced. Differential Revision: https://phab.mercurial-scm.org/D7914
author Rapha?l Gom?s <rgomes@octobus.net>
date Thu, 16 Jan 2020 23:06:01 +0100
parents d8d4fa9a7f18
children 97c10b157665
line wrap: on
line source

// build.rs
//
// Copyright 2020 Raphaël Gomès <rgomes@octobus.net>
//
// This software may be used and distributed according to the terms of the
// GNU General Public License version 2 or any later version.

#[cfg(feature = "with-re2")]
use cc;

#[cfg(feature = "with-re2")]
fn compile_re2() {
    cc::Build::new()
        .cpp(true)
        .flag("-std=c++11")
        .file("src/re2/rust_re2.cpp")
        .compile("librustre.a");

    println!("cargo:rustc-link-lib=re2");
}

fn main() {
    #[cfg(feature = "with-re2")]
    compile_re2();
}