File tree 3 files changed +11
-5
lines changed
3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 5
5
ifneq ($(shell uname) ,FreeBSD)
6
6
ifndef IS_WINDOWS
7
7
all :
8
- $(RUSTC ) --emit link,dep-info --crate-type=lib lib.rs
8
+ cp lib.rs $(TMPDIR ) /
9
+ cp ' foo foo.rs' $(TMPDIR ) /
10
+ cp bar.rs $(TMPDIR ) /
11
+ $(RUSTC ) --emit link,dep-info --crate-type=lib $(TMPDIR ) /lib.rs
9
12
sleep 1
10
- touch ' foo foo.rs'
13
+ touch $( TMPDIR ) / ' foo foo.rs'
11
14
-rm -f $(TMPDIR ) /done
12
15
$(MAKE ) -drf Makefile.foo
13
16
rm $(TMPDIR ) /done
Original file line number Diff line number Diff line change 1
- LIB := $(shell $(RUSTC) --print file-names --crate-type=lib lib.rs)
1
+ LIB := $(shell $(RUSTC) --print file-names --crate-type=lib $(TMPDIR)/ lib.rs)
2
2
3
3
$(TMPDIR)/$(LIB):
4
- $(RUSTC) --emit link,dep-info --crate-type=lib lib.rs
4
+ $(RUSTC) --emit link,dep-info --crate-type=lib $(TMPDIR)/ lib.rs
5
5
touch $(TMPDIR)/done
6
6
7
7
-include $(TMPDIR)/lib.d
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ use rustc_driver::driver::CompileController;
22
22
use rustc_trans:: ModuleSource ;
23
23
use rustc:: session:: Session ;
24
24
use syntax:: codemap:: FileLoader ;
25
+ use std:: env;
25
26
use std:: io;
26
27
use std:: path:: { PathBuf , Path } ;
27
28
@@ -75,9 +76,11 @@ fn main() {
75
76
path. pop ( ) ;
76
77
path. pop ( ) ;
77
78
78
- let args: Vec < String > =
79
+ let mut args: Vec < String > =
79
80
format ! ( "_ _ --sysroot {} --crate-type dylib" , path. to_str( ) . unwrap( ) )
80
81
. split ( ' ' ) . map ( |s| s. to_string ( ) ) . collect ( ) ;
82
+ args. push ( "--out-dir" . to_string ( ) ) ;
83
+ args. push ( env:: var ( "TMPDIR" ) . unwrap ( ) ) ;
81
84
82
85
let ( result, _) = rustc_driver:: run_compiler (
83
86
& args, & mut JitCalls , Some ( box JitLoader ) , None ) ;
You can’t perform that action at this time.
0 commit comments