@@ -455,6 +455,7 @@ pub struct Target {
455455 pub ndk : Option < PathBuf > ,
456456 pub sanitizers : Option < bool > ,
457457 pub profiler : Option < bool > ,
458+ pub rpath : Option < bool > ,
458459 pub crt_static : Option < bool > ,
459460 pub musl_root : Option < PathBuf > ,
460461 pub musl_libdir : Option < PathBuf > ,
@@ -800,6 +801,7 @@ define_config! {
800801 android_ndk: Option <String > = "android-ndk" ,
801802 sanitizers: Option <bool > = "sanitizers" ,
802803 profiler: Option <bool > = "profiler" ,
804+ rpath: Option <bool > = "rpath" ,
803805 crt_static: Option <bool > = "crt-static" ,
804806 musl_root: Option <String > = "musl-root" ,
805807 musl_libdir: Option <String > = "musl-libdir" ,
@@ -1301,6 +1303,7 @@ impl Config {
13011303 target. qemu_rootfs = cfg. qemu_rootfs . map ( PathBuf :: from) ;
13021304 target. sanitizers = cfg. sanitizers ;
13031305 target. profiler = cfg. profiler ;
1306+ target. rpath = cfg. rpath ;
13041307
13051308 config. target_config . insert ( TargetSelection :: from_user ( & triple) , target) ;
13061309 }
@@ -1610,6 +1613,10 @@ impl Config {
16101613 self . target_config . values ( ) . any ( |t| t. profiler == Some ( true ) ) || self . profiler
16111614 }
16121615
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+
16131620 pub fn llvm_enabled ( & self ) -> bool {
16141621 self . rust_codegen_backends . contains ( & INTERNER . intern_str ( "llvm" ) )
16151622 }
0 commit comments