mirror of
https://github.com/apple/sourcekit-lsp.git
synced 2026-03-02 18:23:24 +01:00
@@ -425,23 +425,7 @@ package actor SwiftPMBuildSystem: BuiltInBuildSystem {
|
||||
|
||||
throw NonFileURIError(uri: file)
|
||||
}
|
||||
let compileArguments = try buildTarget.compileArguments(for: fileURL)
|
||||
|
||||
#if compiler(>=6.1)
|
||||
#warning("When we drop support for Swift 5.10 we no longer need to adjust compiler arguments for the Modules move")
|
||||
#endif
|
||||
// Fix up compiler arguments that point to a `/Modules` subdirectory if the Swift version in the toolchain is less
|
||||
// than 6.0 because it places the modules one level higher up.
|
||||
let toolchainVersion = await orLog("Getting Swift version") { try await toolchain.swiftVersion }
|
||||
guard let toolchainVersion, toolchainVersion < SwiftVersion(6, 0) else {
|
||||
return compileArguments
|
||||
}
|
||||
return compileArguments.map { argument in
|
||||
if argument.hasSuffix("/Modules"), argument.contains(self.swiftPMWorkspace.location.scratchDirectory.pathString) {
|
||||
return String(argument.dropLast(8))
|
||||
}
|
||||
return argument
|
||||
}
|
||||
return try buildTarget.compileArguments(for: fileURL)
|
||||
}
|
||||
|
||||
package func buildTargets(request: WorkspaceBuildTargetsRequest) async throws -> WorkspaceBuildTargetsResponse {
|
||||
|
||||
Reference in New Issue
Block a user