@@ -12,6 +12,7 @@ use crate::core::compiler::{
12
12
} ;
13
13
use crate :: core:: { Dependency , Package , Target , TargetKind , Workspace } ;
14
14
use crate :: util:: config:: { Config , StringList , TargetConfig } ;
15
+ use crate :: util:: interning:: InternedString ;
15
16
use crate :: util:: { CargoResult , Rustc } ;
16
17
use anyhow:: Context as _;
17
18
use cargo_platform:: { Cfg , CfgExpr } ;
@@ -43,6 +44,8 @@ pub struct TargetInfo {
43
44
crate_types : RefCell < HashMap < CrateType , Option < ( String , String ) > > > ,
44
45
/// `cfg` information extracted from `rustc --print=cfg`.
45
46
cfg : Vec < Cfg > ,
47
+ /// Supported values for `-Csplit-debuginfo=` flag, queried from rustc
48
+ support_split_debuginfo : Vec < String > ,
46
49
/// Path to the sysroot.
47
50
pub sysroot : PathBuf ,
48
51
/// Path to the "lib" or "bin" directory that rustc uses for its dynamic
@@ -55,8 +58,6 @@ pub struct TargetInfo {
55
58
pub rustflags : Vec < String > ,
56
59
/// Extra flags to pass to `rustdoc`, see [`extra_args`].
57
60
pub rustdocflags : Vec < String > ,
58
- /// Supported values for `-Csplit-debuginfo=` flag, queried from rustc
59
- pub support_split_debuginfo : Vec < String > ,
60
61
}
61
62
62
63
/// Kind of each file generated by a Unit, part of `FileType`.
@@ -547,6 +548,13 @@ impl TargetInfo {
547
548
}
548
549
Ok ( ( result, unsupported) )
549
550
}
551
+
552
+ /// Checks if the debuginfo-split value is supported by this target
553
+ pub fn supports_debuginfo_split ( & self , split : InternedString ) -> bool {
554
+ self . support_split_debuginfo
555
+ . iter ( )
556
+ . any ( |sup| sup. as_str ( ) == split. as_str ( ) )
557
+ }
550
558
}
551
559
552
560
/// Takes rustc output (using specialized command line args), and calculates the file prefix and
0 commit comments