diff --git a/Sources/Build/BuildDescription/SwiftTargetBuildDescription.swift b/Sources/Build/BuildDescription/SwiftTargetBuildDescription.swift index 2fee925a81a..36fb82166fc 100644 --- a/Sources/Build/BuildDescription/SwiftTargetBuildDescription.swift +++ b/Sources/Build/BuildDescription/SwiftTargetBuildDescription.swift @@ -103,12 +103,12 @@ public final class SwiftTargetBuildDescription { } } - var modulesPath: AbsolutePath { + public var modulesPath: AbsolutePath { // note: needs to be public because of sourcekit-lsp return self.buildParameters.buildPath.appending(component: "Modules") } /// The path to the swiftmodule file after compilation. - public var moduleOutputPath: AbsolutePath { // note: needs to be public because of sourcekit-lsp + var moduleOutputPath: AbsolutePath { // If we're an executable and we're not allowing test targets to link against us, we hide the module. let triple = buildParameters.triple let allowLinkingAgainstExecutables = (triple.isDarwin() || triple.isLinux() || triple.isWindows()) && self.toolsVersion >= .v5_5 diff --git a/Sources/Build/BuildPlan/BuildPlan.swift b/Sources/Build/BuildPlan/BuildPlan.swift index cd6ff1cb2f5..dd4aff46ed8 100644 --- a/Sources/Build/BuildPlan/BuildPlan.swift +++ b/Sources/Build/BuildPlan/BuildPlan.swift @@ -526,7 +526,7 @@ public class BuildPlan: SPMBuildCore.BuildPlan { for target in targets { switch target { case .swift(let targetDescription): - arguments += ["-I", targetDescription.moduleOutputPath.parentDirectory.pathString] + arguments += ["-I", targetDescription.modulesPath.pathString] case .clang(let targetDescription): if let includeDir = targetDescription.moduleMap?.parentDirectory { arguments += ["-I", includeDir.pathString]