File tree 4 files changed +35
-3
lines changed
4 files changed +35
-3
lines changed Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
+ #![ deny( warnings) ]
12
+
11
13
extern crate build_helper;
12
14
extern crate gcc;
13
15
@@ -18,6 +20,7 @@ use build_helper::run;
18
20
19
21
fn main ( ) {
20
22
println ! ( "cargo:rustc-cfg=cargobuild" ) ;
23
+ println ! ( "cargo:rerun-if-changed=build.rs" ) ;
21
24
22
25
let target = env:: var ( "TARGET" ) . unwrap ( ) ;
23
26
let host = env:: var ( "HOST" ) . unwrap ( ) ;
@@ -40,6 +43,19 @@ fn main() {
40
43
let cflags = compiler. args ( ) . iter ( ) . map ( |s| s. to_str ( ) . unwrap ( ) )
41
44
. collect :: < Vec < _ > > ( ) . join ( " " ) ;
42
45
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
+
43
59
let mut cmd = Command :: new ( "sh" ) ;
44
60
cmd. arg ( src_dir. join ( "../jemalloc/configure" ) . to_str ( ) . unwrap ( )
45
61
. replace ( "C:\\ " , "/c/" )
Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
+ #![ deny( warnings) ]
12
+
11
13
fn main ( ) {
12
14
// Remove this whenever snapshots and rustbuild nightlies are synced.
13
15
println ! ( "cargo:rustc-cfg=cargobuild" ) ;
16
+ println ! ( "cargo:rerun-if-changed=build.rs" )
14
17
}
Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
+ #![ deny( warnings) ]
12
+
11
13
extern crate gcc;
12
14
extern crate build_helper;
13
15
14
16
use std:: env;
15
- use std:: fs;
16
17
use std:: path:: PathBuf ;
17
18
use std:: process:: Command ;
18
19
19
20
use build_helper:: run;
20
21
21
22
fn main ( ) {
22
23
println ! ( "cargo:rustc-cfg=cargobuild" ) ;
24
+ println ! ( "cargo:rerun-if-changed=build.rs" ) ;
23
25
24
26
let target = env:: var ( "TARGET" ) . unwrap ( ) ;
25
27
let host = env:: var ( "HOST" ) . unwrap ( ) ;
@@ -65,8 +67,16 @@ fn build_libbacktrace(host: &str, target: &str) {
65
67
println ! ( "cargo:rustc-link-lib=static=backtrace" ) ;
66
68
println ! ( "cargo:rustc-link-search=native={}/.libs" , build_dir. display( ) ) ;
67
69
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
+ }
70
80
}
71
81
72
82
let compiler = gcc:: Config :: new ( ) . get_compiler ( ) ;
Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
+ #![ deny( warnings) ]
12
+
11
13
// See comments in Cargo.toml for why this exists
12
14
13
15
fn main ( ) {
14
16
println ! ( "cargo:rustc-cfg=stdbuild" ) ;
17
+ println ! ( "cargo:rerun-if-changed=build.rs" ) ;
15
18
}
You can’t perform that action at this time.
0 commit comments