rust/hg-core/build.rs
author Kyle Lippincott <spectral@google.com>
Thu, 12 Mar 2020 20:08:05 -0700
changeset 44563 1922694d638f
parent 44305 d8d4fa9a7f18
child 44713 97c10b157665
permissions -rw-r--r--
tests: remove doctest in narrowspec, it is broken I think every item here is considered incorrect (if we fix doctest to run it), so let's just delete it. Differential Revision: https://phab.mercurial-scm.org/D8279

// 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();
}