From 428f063fcdc35e048ff79d059a8963334ba2281c Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Fri, 3 Mar 2017 20:11:04 +0300 Subject: Automate timestamp creation and build skipping for native libraries Add comments --- src/liballoc_jemalloc/build.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/liballoc_jemalloc') diff --git a/src/liballoc_jemalloc/build.rs b/src/liballoc_jemalloc/build.rs index cc1e74ccbbf..ae040a23906 100644 --- a/src/liballoc_jemalloc/build.rs +++ b/src/liballoc_jemalloc/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::path::PathBuf; use std::process::Command; use build_helper::{run, native_lib_boilerplate}; @@ -60,11 +58,10 @@ fn main() { } let link_name = if target.contains("windows") { "jemalloc" } else { "jemalloc_pic" }; - let native = native_lib_boilerplate("jemalloc", "jemalloc", link_name, - "rustbuild.timestamp", "lib"); - if native.skip_build { - return - } + let native = match native_lib_boilerplate("jemalloc", "jemalloc", link_name, "lib") { + Ok(native) => native, + _ => return, + }; let compiler = gcc::Config::new().get_compiler(); // only msvc returns None for ar so unwrap is okay @@ -175,6 +172,4 @@ fn main() { .file("pthread_atfork_dummy.c") .compile("libpthread_atfork_dummy.a"); } - - t!(File::create(&native.timestamp)); } -- cgit 1.4.1-3-g733a5