diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2017-03-03 20:11:04 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2017-03-04 21:38:26 +0300 |
| commit | 428f063fcdc35e048ff79d059a8963334ba2281c (patch) | |
| tree | ef19c01e9179f6d455cc6c6a7b3a0cbf316f3119 /src/libstd | |
| parent | c652a4fb566ac4bec1d62c66769dd055ad239df6 (diff) | |
| download | rust-428f063fcdc35e048ff79d059a8963334ba2281c.tar.gz rust-428f063fcdc35e048ff79d059a8963334ba2281c.zip | |
Automate timestamp creation and build skipping for native libraries
Add comments
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/build.rs | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/libstd/build.rs b/src/libstd/build.rs index ef1d3c84f2a..9fb83ad7598 100644 --- a/src/libstd/build.rs +++ b/src/libstd/build.rs @@ -10,12 +10,10 @@ #![deny(warnings)] -#[macro_use] extern crate build_helper; extern crate gcc; use std::env; -use std::fs::File; use std::process::Command; use build_helper::{run, native_lib_boilerplate}; @@ -24,7 +22,7 @@ fn main() { let host = env::var("HOST").expect("HOST was not set"); if cfg!(feature = "backtrace") && !target.contains("apple") && !target.contains("msvc") && !target.contains("emscripten") && !target.contains("fuchsia") && !target.contains("redox") { - build_libbacktrace(&host, &target); + let _ = build_libbacktrace(&host, &target); } if target.contains("linux") { @@ -66,12 +64,8 @@ fn main() { } } -fn build_libbacktrace(host: &str, target: &str) { - let native = native_lib_boilerplate("libbacktrace", "libbacktrace", "backtrace", - "rustbuild.timestamp", ".libs"); - if native.skip_build { - return - } +fn build_libbacktrace(host: &str, target: &str) -> Result<(), ()> { + let native = native_lib_boilerplate("libbacktrace", "libbacktrace", "backtrace", ".libs")?; let compiler = gcc::Config::new().get_compiler(); // only msvc returns None for ar so unwrap is okay @@ -99,6 +93,5 @@ fn build_libbacktrace(host: &str, target: &str) { .current_dir(&native.out_dir) .arg(format!("INCDIR={}", native.src_dir.display())) .arg("-j").arg(env::var("NUM_JOBS").expect("NUM_JOBS was not set"))); - - t!(File::create(&native.timestamp)); + Ok(()) } |
