rust/hg-core/build.rs
changeset 44305 d8d4fa9a7f18
child 44713 97c10b157665
equal deleted inserted replaced
44304:2fe89bec8011 44305:d8d4fa9a7f18
       
     1 // build.rs
       
     2 //
       
     3 // Copyright 2020 Raphaël Gomès <rgomes@octobus.net>
       
     4 //
       
     5 // This software may be used and distributed according to the terms of the
       
     6 // GNU General Public License version 2 or any later version.
       
     7 
       
     8 #[cfg(feature = "with-re2")]
       
     9 use cc;
       
    10 
       
    11 #[cfg(feature = "with-re2")]
       
    12 fn compile_re2() {
       
    13     cc::Build::new()
       
    14         .cpp(true)
       
    15         .flag("-std=c++11")
       
    16         .file("src/re2/rust_re2.cpp")
       
    17         .compile("librustre.a");
       
    18 
       
    19     println!("cargo:rustc-link-lib=re2");
       
    20 }
       
    21 
       
    22 fn main() {
       
    23     #[cfg(feature = "with-re2")]
       
    24     compile_re2();
       
    25 }