Skip to content

Commit f218709

Browse files
committed
Add/remove rerun-if-changed when necessary
1 parent 83cbaf5 commit f218709

File tree

13 files changed

+13
-16
lines changed

13 files changed

+13
-16
lines changed

src/Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/liballoc_jemalloc/build.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ use std::process::Command;
2121
use build_helper::{run, rerun_if_changed_anything_in_dir, up_to_date};
2222

2323
fn main() {
24-
println!("cargo:rerun-if-changed=build.rs");
25-
2624
// FIXME: This is a hack to support building targets that don't
2725
// support jemalloc alongside hosts that do. The jemalloc build is
2826
// controlled by a feature of the std crate, and if that feature

src/libcompiler_builtins/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ doc = false
1515
core = { path = "../libcore" }
1616

1717
[build-dependencies]
18+
build_helper = { path = "../build_helper" }
1819
gcc = "0.3.27"

src/libcompiler_builtins/build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
//! error (if any) and then we just add it to the list. Overall, that cost is
3434
//! far far less than working with compiler-rt's build system over time.
3535
36+
extern crate build_helper;
3637
extern crate gcc;
3738

3839
use std::collections::BTreeMap;
@@ -404,5 +405,8 @@ fn main() {
404405
cfg.file(Path::new("../compiler-rt/lib/builtins").join(src));
405406
}
406407

408+
// Can't reuse `sources` list becuse it doesn't contain header files.
409+
build_helper::rerun_if_changed_anything_in_dir(Path::new("../compiler-rt"));
410+
407411
cfg.compile("libcompiler-rt.a");
408412
}

src/libflate/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
extern crate gcc;
1212

1313
fn main() {
14+
println!("cargo:rerun-if-changed=../rt/miniz.c");
1415
gcc::Config::new()
1516
.file("../rt/miniz.c")
1617
.compile("libminiz.a");

src/librustc_asan/build.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,4 @@ fn main() {
3434
.unwrap())
3535
.join("../compiler-rt"));
3636
}
37-
38-
println!("cargo:rerun-if-changed=build.rs");
3937
}

src/librustc_llvm/build.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,7 @@ fn main() {
144144
cfg.flag("-DLLVM_RUSTLLVM");
145145
}
146146

147-
println!("cargo:rerun-if-changed=../rustllvm/PassWrapper.cpp");
148-
println!("cargo:rerun-if-changed=../rustllvm/RustWrapper.cpp");
149-
println!("cargo:rerun-if-changed=../rustllvm/ArchiveWrapper.cpp");
147+
build_helper::rerun_if_changed_anything_in_dir(Path::new("../rustllvm"));
150148
cfg.file("../rustllvm/PassWrapper.cpp")
151149
.file("../rustllvm/RustWrapper.cpp")
152150
.file("../rustllvm/ArchiveWrapper.cpp")

src/librustc_lsan/build.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,4 @@ fn main() {
3434
.unwrap())
3535
.join("../compiler-rt"));
3636
}
37-
38-
println!("cargo:rerun-if-changed=build.rs");
3937
}

src/librustc_msan/build.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,4 @@ fn main() {
3434
.unwrap())
3535
.join("../compiler-rt"));
3636
}
37-
38-
println!("cargo:rerun-if-changed=build.rs");
3937
}

src/librustc_tsan/build.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,4 @@ fn main() {
3434
.unwrap())
3535
.join("../compiler-rt"));
3636
}
37-
38-
println!("cargo:rerun-if-changed=build.rs");
3937
}

src/librustdoc/build.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
extern crate build_helper;
1112
extern crate gcc;
1213

1314
fn main() {
15+
let src_dir = std::path::Path::new("../rt/hoedown/src");
16+
build_helper::rerun_if_changed_anything_in_dir(src_dir);
1417
let mut cfg = gcc::Config::new();
1518
cfg.file("../rt/hoedown/src/autolink.c")
1619
.file("../rt/hoedown/src/buffer.c")
@@ -21,6 +24,6 @@ fn main() {
2124
.file("../rt/hoedown/src/html_smartypants.c")
2225
.file("../rt/hoedown/src/stack.c")
2326
.file("../rt/hoedown/src/version.c")
24-
.include("../rt/hoedown/src")
27+
.include(src_dir)
2528
.compile("libhoedown.a");
2629
}

src/libstd/build.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ use std::process::Command;
2121
use build_helper::{run, rerun_if_changed_anything_in_dir, up_to_date};
2222

2323
fn main() {
24-
println!("cargo:rerun-if-changed=build.rs");
25-
2624
let target = env::var("TARGET").expect("TARGET was not set");
2725
let host = env::var("HOST").expect("HOST was not set");
2826
if cfg!(feature = "backtrace") && !target.contains("apple") && !target.contains("msvc") &&

src/libunwind/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use std::env;
1212

1313
fn main() {
14+
println!("cargo:rerun-if-changed=build.rs");
1415
let target = env::var("TARGET").expect("TARGET was not set");
1516

1617
if target.contains("linux") {

0 commit comments

Comments
 (0)