File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
compiler/rustc_target/src/spec Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -367,6 +367,25 @@ impl LinkerFlavor {
367
367
| LinkerFlavor :: Ptx => false ,
368
368
}
369
369
}
370
+
371
+ /// Returns whether the flavor calls the linker via a C/C++ compiler.
372
+ pub fn uses_cc ( self ) -> bool {
373
+ // Exhaustive match in case new flavors are added in the future.
374
+ match self {
375
+ LinkerFlavor :: Gnu ( Cc :: Yes , _)
376
+ | LinkerFlavor :: Darwin ( Cc :: Yes , _)
377
+ | LinkerFlavor :: WasmLld ( Cc :: Yes )
378
+ | LinkerFlavor :: Unix ( Cc :: Yes )
379
+ | LinkerFlavor :: EmCc => true ,
380
+ LinkerFlavor :: Gnu ( ..)
381
+ | LinkerFlavor :: Darwin ( ..)
382
+ | LinkerFlavor :: WasmLld ( _)
383
+ | LinkerFlavor :: Msvc ( _)
384
+ | LinkerFlavor :: Unix ( _)
385
+ | LinkerFlavor :: Bpf
386
+ | LinkerFlavor :: Ptx => false ,
387
+ }
388
+ }
370
389
}
371
390
372
391
macro_rules! linker_flavor_cli_impls {
You can’t perform that action at this time.
0 commit comments