Skip to content

Commit e439947

Browse files
committed
Use correct build paths for auxiliary tools
1 parent 8a784a6 commit e439947

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Sources/Build/BuildPlan/BuildPlan.swift

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,18 @@ public class BuildPlan: SPMBuildCore.BuildPlan {
448448

449449
public func createAPIToolCommonArgs(includeLibrarySearchPaths: Bool) throws -> [String] {
450450
let buildPath = buildParameters.buildPath.pathString
451-
var arguments = ["-I", buildPath]
451+
var arguments = ["-I"]
452+
453+
if let target = targets.compactMap({
454+
switch $0 {
455+
case .swift(let desc): return desc
456+
case .clang: return nil
457+
}
458+
}).first {
459+
arguments += [target.moduleOutputPath.pathString]
460+
} else {
461+
arguments += [buildPath]
462+
}
452463

453464
// swift-symbolgraph-extract does not support parsing `-use-ld=lld` and
454465
// will silently error failing the operation. Filter out this flag

0 commit comments

Comments
 (0)