about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2016-04-29 10:39:28 -0700
committerAlex Crichton <alex@alexcrichton.com>2016-05-10 23:41:19 -0700
commit8d65591cf249a64bffa14ed49cb196af4eabac3c (patch)
tree45a17a4c8bc538307cd7072ddfd7537146ed4bd3 /src/libstd
parent80ec1b9f1040fba67846924234167feeb24d1f68 (diff)
downloadrust-8d65591cf249a64bffa14ed49cb196af4eabac3c.tar.gz
rust-8d65591cf249a64bffa14ed49cb196af4eabac3c.zip
rustbuild: Tighten dependencies of build scripts
Ensure that `rerun-if-changed` is printed for all build scripts to ensure that
they've all got the right list of dependencies.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/build.rs16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/libstd/build.rs b/src/libstd/build.rs
index e879d440643..ff9dacbb679 100644
--- a/src/libstd/build.rs
+++ b/src/libstd/build.rs
@@ -8,11 +8,12 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![deny(warnings)]
+
 extern crate gcc;
 extern crate build_helper;
 
 use std::env;
-use std::fs;
 use std::path::PathBuf;
 use std::process::Command;
 
@@ -20,6 +21,7 @@ use build_helper::run;
 
 fn main() {
     println!("cargo:rustc-cfg=cargobuild");
+    println!("cargo:rerun-if-changed=build.rs");
 
     let target = env::var("TARGET").unwrap();
     let host = env::var("HOST").unwrap();
@@ -65,8 +67,16 @@ fn build_libbacktrace(host: &str, target: &str) {
     println!("cargo:rustc-link-lib=static=backtrace");
     println!("cargo:rustc-link-search=native={}/.libs", build_dir.display());
 
-    if fs::metadata(&build_dir.join(".libs/libbacktrace.a")).is_ok() {
-        return
+    let mut stack = src_dir.read_dir().unwrap()
+                           .map(|e| e.unwrap())
+                           .collect::<Vec<_>>();
+    while let Some(entry) = stack.pop() {
+        let path = entry.path();
+        if entry.file_type().unwrap().is_dir() {
+            stack.extend(path.read_dir().unwrap().map(|e| e.unwrap()));
+        } else {
+            println!("cargo:rerun-if-changed={}", path.display());
+        }
     }
 
     let compiler = gcc::Config::new().get_compiler();