Skip to content

Commit d55e9a3

Browse files
[WITExtractor] Stop including per-config build directory for Swift 6.0+
1 parent 16683fd commit d55e9a3

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Plugins/WITExtractorPlugin/Plugin.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,16 @@ struct Plugin: CommandPlugin {
4848
"--package-name", context.package.displayName,
4949
"--wit-output-path", witOutputPath.string,
5050
"--swift-output-path", swiftOutputPath.string,
51-
"-I", buildPath.string,
52-
// SwiftPM 6.0 and later emits swiftmodule files into a separate directory
53-
// https://github.com/swiftlang/swift-package-manager/pull/7212
5451
"-I", buildPath.appending(["Modules"]).string,
5552
]
53+
54+
#if compiler(<6.0)
55+
// Swift 5.10 and earlier emit module files under the per-configuration build directory
56+
// instead of the Modules directory.
57+
arguments += [
58+
"-I", buildPath.string,
59+
]
60+
#endif
5661
if let sdk {
5762
arguments += ["-sdk", sdk]
5863
}

0 commit comments

Comments
 (0)