@@ -12,6 +12,7 @@ use crate::core::compiler::{
1212} ;
1313use crate :: core:: { Dependency , Package , Target , TargetKind , Workspace } ;
1414use crate :: util:: config:: { Config , StringList , TargetConfig } ;
15+ use crate :: util:: interning:: InternedString ;
1516use crate :: util:: { CargoResult , Rustc } ;
1617use anyhow:: Context as _;
1718use cargo_platform:: { Cfg , CfgExpr } ;
@@ -43,6 +44,8 @@ pub struct TargetInfo {
4344 crate_types : RefCell < HashMap < CrateType , Option < ( String , String ) > > > ,
4445 /// `cfg` information extracted from `rustc --print=cfg`.
4546 cfg : Vec < Cfg > ,
47+ /// Supported values for `-Csplit-debuginfo=` flag, queried from rustc
48+ support_split_debuginfo : Vec < String > ,
4649 /// Path to the sysroot.
4750 pub sysroot : PathBuf ,
4851 /// Path to the "lib" or "bin" directory that rustc uses for its dynamic
@@ -55,8 +58,6 @@ pub struct TargetInfo {
5558 pub rustflags : Vec < String > ,
5659 /// Extra flags to pass to `rustdoc`, see [`extra_args`].
5760 pub rustdocflags : Vec < String > ,
58- /// Supported values for `-Csplit-debuginfo=` flag, queried from rustc
59- pub support_split_debuginfo : Vec < String > ,
6061}
6162
6263/// Kind of each file generated by a Unit, part of `FileType`.
@@ -547,6 +548,13 @@ impl TargetInfo {
547548 }
548549 Ok ( ( result, unsupported) )
549550 }
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+ }
550558}
551559
552560/// Takes rustc output (using specialized command line args), and calculates the file prefix and
0 commit comments