File tree Expand file tree Collapse file tree 4 files changed +35
-3
lines changed Expand file tree Collapse file tree 4 files changed +35
-3
lines changed Original file line number Diff line number Diff line change 88// option. This file may not be copied, modified, or distributed
99// except according to those terms.
1010
11+ #![ deny( warnings) ]
12+
1113extern crate build_helper;
1214extern crate gcc;
1315
@@ -18,6 +20,7 @@ use build_helper::run;
1820
1921fn main ( ) {
2022 println ! ( "cargo:rustc-cfg=cargobuild" ) ;
23+ println ! ( "cargo:rerun-if-changed=build.rs" ) ;
2124
2225 let target = env:: var ( "TARGET" ) . unwrap ( ) ;
2326 let host = env:: var ( "HOST" ) . unwrap ( ) ;
@@ -40,6 +43,19 @@ fn main() {
4043 let cflags = compiler. args ( ) . iter ( ) . map ( |s| s. to_str ( ) . unwrap ( ) )
4144 . collect :: < Vec < _ > > ( ) . join ( " " ) ;
4245
46+ let mut stack = src_dir. join ( "../jemalloc" )
47+ . read_dir ( ) . unwrap ( )
48+ . map ( |e| e. unwrap ( ) )
49+ . collect :: < Vec < _ > > ( ) ;
50+ while let Some ( entry) = stack. pop ( ) {
51+ let path = entry. path ( ) ;
52+ if entry. file_type ( ) . unwrap ( ) . is_dir ( ) {
53+ stack. extend ( path. read_dir ( ) . unwrap ( ) . map ( |e| e. unwrap ( ) ) ) ;
54+ } else {
55+ println ! ( "cargo:rerun-if-changed={}" , path. display( ) ) ;
56+ }
57+ }
58+
4359 let mut cmd = Command :: new ( "sh" ) ;
4460 cmd. arg ( src_dir. join ( "../jemalloc/configure" ) . to_str ( ) . unwrap ( )
4561 . replace ( "C:\\ " , "/c/" )
Original file line number Diff line number Diff line change 88// option. This file may not be copied, modified, or distributed
99// except according to those terms.
1010
11+ #![ deny( warnings) ]
12+
1113fn main ( ) {
1214 // Remove this whenever snapshots and rustbuild nightlies are synced.
1315 println ! ( "cargo:rustc-cfg=cargobuild" ) ;
16+ println ! ( "cargo:rerun-if-changed=build.rs" )
1417}
Original file line number Diff line number Diff line change 88// option. This file may not be copied, modified, or distributed
99// except according to those terms.
1010
11+ #![ deny( warnings) ]
12+
1113extern crate gcc;
1214extern crate build_helper;
1315
1416use std:: env;
15- use std:: fs;
1617use std:: path:: PathBuf ;
1718use std:: process:: Command ;
1819
1920use build_helper:: run;
2021
2122fn main ( ) {
2223 println ! ( "cargo:rustc-cfg=cargobuild" ) ;
24+ println ! ( "cargo:rerun-if-changed=build.rs" ) ;
2325
2426 let target = env:: var ( "TARGET" ) . unwrap ( ) ;
2527 let host = env:: var ( "HOST" ) . unwrap ( ) ;
@@ -65,8 +67,16 @@ fn build_libbacktrace(host: &str, target: &str) {
6567 println ! ( "cargo:rustc-link-lib=static=backtrace" ) ;
6668 println ! ( "cargo:rustc-link-search=native={}/.libs" , build_dir. display( ) ) ;
6769
68- if fs:: metadata ( & build_dir. join ( ".libs/libbacktrace.a" ) ) . is_ok ( ) {
69- return
70+ let mut stack = src_dir. read_dir ( ) . unwrap ( )
71+ . map ( |e| e. unwrap ( ) )
72+ . collect :: < Vec < _ > > ( ) ;
73+ while let Some ( entry) = stack. pop ( ) {
74+ let path = entry. path ( ) ;
75+ if entry. file_type ( ) . unwrap ( ) . is_dir ( ) {
76+ stack. extend ( path. read_dir ( ) . unwrap ( ) . map ( |e| e. unwrap ( ) ) ) ;
77+ } else {
78+ println ! ( "cargo:rerun-if-changed={}" , path. display( ) ) ;
79+ }
7080 }
7181
7282 let compiler = gcc:: Config :: new ( ) . get_compiler ( ) ;
Original file line number Diff line number Diff line change 88// option. This file may not be copied, modified, or distributed
99// except according to those terms.
1010
11+ #![ deny( warnings) ]
12+
1113// See comments in Cargo.toml for why this exists
1214
1315fn main ( ) {
1416 println ! ( "cargo:rustc-cfg=stdbuild" ) ;
17+ println ! ( "cargo:rerun-if-changed=build.rs" ) ;
1518}
You can’t perform that action at this time.
0 commit comments