@@ -455,6 +455,7 @@ pub struct Target {
455
455
pub ndk : Option < PathBuf > ,
456
456
pub sanitizers : Option < bool > ,
457
457
pub profiler : Option < bool > ,
458
+ pub rpath : Option < bool > ,
458
459
pub crt_static : Option < bool > ,
459
460
pub musl_root : Option < PathBuf > ,
460
461
pub musl_libdir : Option < PathBuf > ,
@@ -800,6 +801,7 @@ define_config! {
800
801
android_ndk: Option <String > = "android-ndk" ,
801
802
sanitizers: Option <bool > = "sanitizers" ,
802
803
profiler: Option <bool > = "profiler" ,
804
+ rpath: Option <bool > = "rpath" ,
803
805
crt_static: Option <bool > = "crt-static" ,
804
806
musl_root: Option <String > = "musl-root" ,
805
807
musl_libdir: Option <String > = "musl-libdir" ,
@@ -1301,6 +1303,7 @@ impl Config {
1301
1303
target. qemu_rootfs = cfg. qemu_rootfs . map ( PathBuf :: from) ;
1302
1304
target. sanitizers = cfg. sanitizers ;
1303
1305
target. profiler = cfg. profiler ;
1306
+ target. rpath = cfg. rpath ;
1304
1307
1305
1308
config. target_config . insert ( TargetSelection :: from_user ( & triple) , target) ;
1306
1309
}
@@ -1610,6 +1613,10 @@ impl Config {
1610
1613
self . target_config . values ( ) . any ( |t| t. profiler == Some ( true ) ) || self . profiler
1611
1614
}
1612
1615
1616
+ pub fn rpath_enabled ( & self , target : TargetSelection ) -> bool {
1617
+ self . target_config . get ( & target) . map ( |t| t. rpath ) . flatten ( ) . unwrap_or ( self . rust_rpath )
1618
+ }
1619
+
1613
1620
pub fn llvm_enabled ( & self ) -> bool {
1614
1621
self . rust_codegen_backends . contains ( & INTERNER . intern_str ( "llvm" ) )
1615
1622
}
0 commit comments