@@ -566,23 +566,23 @@ extension Driver {
566
566
. appending ( components: frontendTargetInfo. target. triple. platformName ( ) ?? " " , " Swift.swiftmodule " )
567
567
let hasToolchainStdlib = try fileSystem. exists ( toolchainStdlibPath)
568
568
569
- let skipMacroOptions = isPlanJobForExplicitModule && isFrontendArgSupported ( . loadResolvedPlugin)
569
+ let skipMacroSearchPath = isPlanJobForExplicitModule && isFrontendArgSupported ( . loadResolvedPlugin)
570
570
// If the resource directory has the standard library, prefer the toolchain's plugins
571
571
// to the platform SDK plugins.
572
572
// For explicit module build, the resolved plugins are provided by scanner.
573
- if hasToolchainStdlib, !skipMacroOptions {
574
- try addPluginPathArguments ( commandLine: & commandLine)
573
+ if hasToolchainStdlib {
574
+ try addPluginPathArguments ( commandLine: & commandLine, skipMacroSearchPath : skipMacroSearchPath )
575
575
}
576
576
577
577
try toolchain. addPlatformSpecificCommonFrontendOptions ( commandLine: & commandLine,
578
578
inputs: & inputs,
579
579
frontendTargetInfo: frontendTargetInfo,
580
580
driver: & self ,
581
- skipMacroOptions: skipMacroOptions )
581
+ skipMacroOptions: skipMacroSearchPath )
582
582
583
583
// Otherwise, prefer the platform's plugins.
584
- if !hasToolchainStdlib, !skipMacroOptions {
585
- try addPluginPathArguments ( commandLine: & commandLine)
584
+ if !hasToolchainStdlib {
585
+ try addPluginPathArguments ( commandLine: & commandLine, skipMacroSearchPath : skipMacroSearchPath )
586
586
}
587
587
588
588
if let passPluginPath = parsedOptions. getLastArgument ( . loadPassPluginEQ) ,
@@ -937,7 +937,7 @@ extension Driver {
937
937
try explicitDependencyBuildPlanner? . resolveBridgingHeaderDependencies ( inputs: & inputs, commandLine: & commandLine)
938
938
}
939
939
940
- mutating func addPluginPathArguments( commandLine: inout [ Job . ArgTemplate ] ) throws {
940
+ mutating func addPluginPathArguments( commandLine: inout [ Job . ArgTemplate ] , skipMacroSearchPath : Bool ) throws {
941
941
guard isFrontendArgSupported ( . pluginPath) else {
942
942
return
943
943
}
@@ -952,6 +952,10 @@ extension Driver {
952
952
#endif
953
953
}
954
954
955
+ guard !skipMacroSearchPath else {
956
+ return
957
+ }
958
+
955
959
// Default paths for compiler plugins found within the toolchain
956
960
// (loaded as shared libraries).
957
961
commandLine. appendFlag ( . pluginPath)
0 commit comments