@@ -996,6 +996,32 @@ impl OutputFilenames {
996
996
}
997
997
}
998
998
999
+ bitflags:: bitflags! {
1000
+ /// Scopes used to determined if it need to apply to --remap-path-prefix
1001
+ pub struct RemapPathScopeComponents : u8 {
1002
+ /// Apply remappings to the expansion of std::file!() macro
1003
+ const MACRO = 1 << 0 ;
1004
+ /// Apply remappings to printed compiler diagnostics
1005
+ const DIAGNOSTICS = 1 << 1 ;
1006
+ /// Apply remappings to debug information only when they are written to
1007
+ /// compiled executables or libraries, but not when they are in split
1008
+ /// debuginfo files
1009
+ const UNSPLIT_DEBUGINFO = 1 << 2 ;
1010
+ /// Apply remappings to debug information only when they are written to
1011
+ /// split debug information files, but not in compiled executables or
1012
+ /// libraries
1013
+ const SPLIT_DEBUGINFO = 1 << 3 ;
1014
+ /// Apply remappings to the paths pointing to split debug information
1015
+ /// files. Does nothing when these files are not generated.
1016
+ const SPLIT_DEBUGINFO_PATH = 1 << 4 ;
1017
+
1018
+ /// An alias for macro,unsplit-debuginfo,split-debuginfo-path. This
1019
+ /// ensures all paths in compiled executables or libraries are remapped
1020
+ /// but not elsewhere.
1021
+ const OBJECT = Self :: MACRO . bits | Self :: UNSPLIT_DEBUGINFO . bits | Self :: SPLIT_DEBUGINFO_PATH . bits;
1022
+ }
1023
+ }
1024
+
999
1025
pub fn host_triple ( ) -> & ' static str {
1000
1026
// Get the host triple out of the build environment. This ensures that our
1001
1027
// idea of the host triple is the same as for the set of libraries we've
@@ -3115,9 +3141,9 @@ pub(crate) mod dep_tracking {
3115
3141
use super :: {
3116
3142
BranchProtection , CFGuard , CFProtection , CrateType , DebugInfo , ErrorOutputType ,
3117
3143
InstrumentCoverage , InstrumentXRay , LdImpl , LinkerPluginLto , LocationDetail , LtoCli ,
3118
- OomStrategy , OptLevel , OutFileName , OutputType , OutputTypes , Passes , ResolveDocLinks ,
3119
- SourceFileHashAlgorithm , SplitDwarfKind , SwitchWithOptPath , SymbolManglingVersion ,
3120
- TraitSolver , TrimmedDefPaths ,
3144
+ OomStrategy , OptLevel , OutFileName , OutputType , OutputTypes , Passes ,
3145
+ RemapPathScopeComponents , ResolveDocLinks , SourceFileHashAlgorithm , SplitDwarfKind ,
3146
+ SwitchWithOptPath , SymbolManglingVersion , TraitSolver , TrimmedDefPaths ,
3121
3147
} ;
3122
3148
use crate :: lint;
3123
3149
use crate :: options:: WasiExecModel ;
@@ -3210,6 +3236,7 @@ pub(crate) mod dep_tracking {
3210
3236
StackProtector ,
3211
3237
SwitchWithOptPath ,
3212
3238
SymbolManglingVersion ,
3239
+ RemapPathScopeComponents ,
3213
3240
SourceFileHashAlgorithm ,
3214
3241
TrimmedDefPaths ,
3215
3242
Option <LdImpl >,
0 commit comments