File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ pub struct Library {
98
98
pub frameworks : Vec < String > ,
99
99
pub framework_paths : Vec < PathBuf > ,
100
100
pub include_paths : Vec < PathBuf > ,
101
+ pub rpaths : Vec < PathBuf > ,
101
102
pub defines : HashMap < String , Option < String > > ,
102
103
pub version : String ,
103
104
_priv : ( ) ,
@@ -557,6 +558,7 @@ impl Library {
557
558
libs : Vec :: new ( ) ,
558
559
link_paths : Vec :: new ( ) ,
559
560
include_paths : Vec :: new ( ) ,
561
+ rpaths : Vec :: new ( ) ,
560
562
frameworks : Vec :: new ( ) ,
561
563
framework_paths : Vec :: new ( ) ,
562
564
defines : HashMap :: new ( ) ,
@@ -667,6 +669,13 @@ impl Library {
667
669
self . include_paths . push ( PathBuf :: from ( inc) ) ;
668
670
}
669
671
}
672
+ "-rpath" => {
673
+ if let Some ( rpath) = iter. next ( ) {
674
+ let meta = format ! ( "rustc-link-arg=-Wl,-rpath,{}" , rpath) ;
675
+ config. print_metadata ( & meta) ;
676
+ self . rpaths . push ( PathBuf :: from ( rpath) ) ;
677
+ }
678
+ }
670
679
_ => ( ) ,
671
680
}
672
681
}
Original file line number Diff line number Diff line change
1
+ prefix=/usr/local
2
+
3
+ Name: rpath
4
+ Version: 4.2.0
5
+ Description: RPath example library
6
+ Libs: -L${prefix}/lib -Wl,-rpath,${prefix}/lib -lrpath
7
+ Cflags: -I${prefix}/include
Original file line number Diff line number Diff line change @@ -311,3 +311,11 @@ fn range_version_full() {
311
311
. probe ( "escape" )
312
312
. unwrap ( ) ;
313
313
}
314
+
315
+ #[ test]
316
+ fn rpath ( ) {
317
+ let _g = LOCK . lock ( ) ;
318
+ reset ( ) ;
319
+ let lib = find ( "rpath" ) . unwrap ( ) ;
320
+ assert ! ( lib. rpaths. contains( & PathBuf :: from( "/usr/local/lib" ) ) ) ;
321
+ }
You can’t perform that action at this time.
0 commit comments