Skip to content

Commit

Permalink
Merge pull request swiftlang#1616 from rintaro/in-process-plugin-server
Browse files Browse the repository at this point in the history
Add In-process plugin server path
  • Loading branch information
rintaro authored Jun 26, 2024
2 parents 7eb6a10 + 2e9f154 commit 6d1e5d2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -790,10 +790,19 @@ extension Driver {
guard isFrontendArgSupported(.pluginPath) else {
return
}
let pluginPathRoot = VirtualPath.absolute(try toolchain.executableDir.parentDirectory)

if isFrontendArgSupported(.inProcessPluginServerPath) {
commandLine.appendFlag(.inProcessPluginServerPath)
#if os(Windows)
commandLine.appendPath(pluginPathRoot.appending(components: "bin", sharedLibraryName("SwiftInProcPluginServer")))
#else
commandLine.appendPath(pluginPathRoot.appending(components: "lib", "swift", "host", sharedLibraryName("libSwiftInProcPluginServer")))
#endif
}

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

Expand Down
2 changes: 2 additions & 0 deletions Sources/SwiftOptions/Options.swift
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ extension Option {
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")
public static let importUnderlyingModule: Option = Option("-import-underlying-module", .flag, attributes: [.frontend, .noInteractive], helpText: "Implicitly imports the Objective-C half of a module")
public static let inPlace: Option = Option("-in-place", .flag, attributes: [.noInteractive, .noBatch, .indent], helpText: "Overwrite input file with formatted file.", group: .codeFormatting)
public static let inProcessPluginServerPath: Option = Option("-in-process-plugin-server-path", .separate, attributes: [.frontend, .argumentIsPath], helpText: "Path to dynamic library plugin server")
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")
public static let incremental: Option = Option("-incremental", .flag, attributes: [.helpHidden, .noInteractive, .doesNotAffectIncrementalBuild], helpText: "Perform an incremental build if possible")
public static let indentSwitchCase: Option = Option("-indent-switch-case", .flag, attributes: [.noInteractive, .noBatch, .indent], helpText: "Indent cases in switch statements.", group: .codeFormatting)
Expand Down Expand Up @@ -1416,6 +1417,7 @@ extension Option {
Option.importPrescan,
Option.importUnderlyingModule,
Option.inPlace,
Option.inProcessPluginServerPath,
Option.includeSpiSymbols,
Option.incremental,
Option.indentSwitchCase,
Expand Down

0 comments on commit 6d1e5d2

Please sign in to comment.