diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2017-03-03 02:15:56 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2017-03-04 21:38:26 +0300 |
| commit | aeadc81ddcf25df677f75d781aa2ec9d732bb6f4 (patch) | |
| tree | d209490ee1c2b510925e19c754ce4b521653c240 /src/libcompiler_builtins | |
| parent | a7c8afd28d45018f3c3af9dec569c36bd4dea10a (diff) | |
| download | rust-aeadc81ddcf25df677f75d781aa2ec9d732bb6f4.tar.gz rust-aeadc81ddcf25df677f75d781aa2ec9d732bb6f4.zip | |
Build compiler-rt and sanitizers only once
Diffstat (limited to 'src/libcompiler_builtins')
| -rw-r--r-- | src/libcompiler_builtins/build.rs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/libcompiler_builtins/build.rs b/src/libcompiler_builtins/build.rs index 564404ca71d..ff5111a15be 100644 --- a/src/libcompiler_builtins/build.rs +++ b/src/libcompiler_builtins/build.rs @@ -39,6 +39,7 @@ extern crate gcc; use std::collections::BTreeMap; use std::env; use std::path::Path; +use build_helper::native_lib_boilerplate; struct Sources { // SYMBOL -> PATH TO SOURCE @@ -80,7 +81,17 @@ fn main() { return; } + // Can't reuse `sources` list for the freshness check becuse it doesn't contain header files. + // Use the produced library itself as a timestamp. + let out_name = "libcompiler-rt.a"; + let native = native_lib_boilerplate("compiler-rt", "compiler-rt", "compiler-rt", + out_name, "."); + if native.skip_build { + return + } + let cfg = &mut gcc::Config::new(); + cfg.out_dir(native.out_dir); if target.contains("msvc") { // Don't pull in extra libraries on MSVC @@ -405,8 +416,5 @@ fn main() { cfg.file(Path::new("../compiler-rt/lib/builtins").join(src)); } - // Can't reuse `sources` list becuse it doesn't contain header files. - build_helper::rerun_if_changed_anything_in_dir(Path::new("../compiler-rt")); - - cfg.compile("libcompiler-rt.a"); + cfg.compile(out_name); } |
