view rust/hg-core/build.rs @ 44668:c11d98cff883

rust-chg: add brief comment about initial capacity of temp_sock_path() I don't know if it can be expressed as a compile-time constant, so it's a comment for now. About this series: This is quite old patches for rust-chg. I heard from Octobus people that there's a plan to do an experiment on merging hgcli + chg + some Rust?, so I decided to respin the rust-chg series. Maybe we'll rewrite the core to leverage the recent async/await functionality, but I want to first make my old patches in so the rust-chg can be a drop-in replacement for the chg of C. Compiler warnings will be removed later, and the codebase will be upgraded to the 2018 edition later. Differential Revision: https://phab.mercurial-scm.org/D8357
author Yuya Nishihara <yuya@tcha.org>
date Sun, 14 Oct 2018 14:41:14 +0200
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();
}