Skip to content

Commit 2e9f154

Browse files
committed
Add In-process plugin server path
1 parent dd5bbca commit 2e9f154

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift

+10-1
Original file line numberDiff line numberDiff line change
@@ -781,10 +781,19 @@ extension Driver {
781781
guard isFrontendArgSupported(.pluginPath) else {
782782
return
783783
}
784+
let pluginPathRoot = VirtualPath.absolute(try toolchain.executableDir.parentDirectory)
785+
786+
if isFrontendArgSupported(.inProcessPluginServerPath) {
787+
commandLine.appendFlag(.inProcessPluginServerPath)
788+
#if os(Windows)
789+
commandLine.appendPath(pluginPathRoot.appending(components: "bin", sharedLibraryName("SwiftInProcPluginServer")))
790+
#else
791+
commandLine.appendPath(pluginPathRoot.appending(components: "lib", "swift", "host", sharedLibraryName("libSwiftInProcPluginServer")))
792+
#endif
793+
}
784794

785795
// Default paths for compiler plugins found within the toolchain
786796
// (loaded as shared libraries).
787-
let pluginPathRoot = VirtualPath.absolute(try toolchain.executableDir.parentDirectory)
788797
commandLine.appendFlag(.pluginPath)
789798
commandLine.appendPath(pluginPathRoot.pluginPath)
790799

Sources/SwiftOptions/Options.swift

+2
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@ extension Option {
546546
public static let importPrescan: Option = Option("-import-prescan", .flag, attributes: [.frontend, .noDriver], helpText: "When performing a dependency scan, only identify all imports of the main Swift module sources")
547547
public static let importUnderlyingModule: Option = Option("-import-underlying-module", .flag, attributes: [.frontend, .noInteractive], helpText: "Implicitly imports the Objective-C half of a module")
548548
public static let inPlace: Option = Option("-in-place", .flag, attributes: [.noInteractive, .noBatch, .indent], helpText: "Overwrite input file with formatted file.", group: .codeFormatting)
549+
public static let inProcessPluginServerPath: Option = Option("-in-process-plugin-server-path", .separate, attributes: [.frontend, .argumentIsPath], helpText: "Path to dynamic library plugin server")
549550
public static let includeSpiSymbols: Option = Option("-include-spi-symbols", .flag, attributes: [.helpHidden, .frontend, .noInteractive, .supplementaryOutput], helpText: "Add symbols with SPI information to the symbol graph")
550551
public static let incremental: Option = Option("-incremental", .flag, attributes: [.helpHidden, .noInteractive, .doesNotAffectIncrementalBuild], helpText: "Perform an incremental build if possible")
551552
public static let indentSwitchCase: Option = Option("-indent-switch-case", .flag, attributes: [.noInteractive, .noBatch, .indent], helpText: "Indent cases in switch statements.", group: .codeFormatting)
@@ -1399,6 +1400,7 @@ extension Option {
13991400
Option.importPrescan,
14001401
Option.importUnderlyingModule,
14011402
Option.inPlace,
1403+
Option.inProcessPluginServerPath,
14021404
Option.includeSpiSymbols,
14031405
Option.incremental,
14041406
Option.indentSwitchCase,

0 commit comments

Comments
 (0)