diff options
| -rw-r--r-- | src/liballoc_jemalloc/build.rs | 16 | ||||
| -rw-r--r-- | src/libcore/build.rs | 3 | ||||
| -rw-r--r-- | src/libstd/build.rs | 16 | ||||
| -rw-r--r-- | src/rustc/libc_shim/build.rs | 3 |
4 files changed, 35 insertions, 3 deletions
diff --git a/src/liballoc_jemalloc/build.rs b/src/liballoc_jemalloc/build.rs index 5d521913b48..33a675331ab 100644 --- a/src/liballoc_jemalloc/build.rs +++ b/src/liballoc_jemalloc/build.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![deny(warnings)] + extern crate build_helper; extern crate gcc; @@ -18,6 +20,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(); @@ -40,6 +43,19 @@ fn main() { let cflags = compiler.args().iter().map(|s| s.to_str().unwrap()) .collect::<Vec<_>>().join(" "); + let mut stack = src_dir.join("../jemalloc") + .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 mut cmd = Command::new("sh"); cmd.arg(src_dir.join("../jemalloc/configure").to_str().unwrap() .replace("C:\\", "/c/") diff --git a/src/libcore/build.rs b/src/libcore/build.rs index a991ac0de1a..255a367e58b 100644 --- a/src/libcore/build.rs +++ b/src/libcore/build.rs @@ -8,7 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![deny(warnings)] + fn main() { // Remove this whenever snapshots and rustbuild nightlies are synced. println!("cargo:rustc-cfg=cargobuild"); + println!("cargo:rerun-if-changed=build.rs") } 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(); diff --git a/src/rustc/libc_shim/build.rs b/src/rustc/libc_shim/build.rs index bc428d69082..546f60482e7 100644 --- a/src/rustc/libc_shim/build.rs +++ b/src/rustc/libc_shim/build.rs @@ -8,8 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![deny(warnings)] + // See comments in Cargo.toml for why this exists fn main() { println!("cargo:rustc-cfg=stdbuild"); + println!("cargo:rerun-if-changed=build.rs"); } |
