@@ -23,13 +23,18 @@ import class Build.ClangTargetBuildDescription
23
23
import class Build. SwiftTargetBuildDescription
24
24
import struct PackageGraph. ResolvedTarget
25
25
import struct PackageGraph. ModulesGraph
26
+ import enum PackageGraph. BuildTriple
27
+
28
+ public typealias BuildTriple = PackageGraph . BuildTriple
26
29
27
30
public protocol BuildTarget {
28
31
var sources : [ URL ] { get }
29
32
30
33
/// The name of the target. It should be possible to build a target by passing this name to `swift build --target`
31
34
var name : String { get }
32
35
36
+ var buildTriple : BuildTriple { get }
37
+
33
38
/// Whether the target is part of the root package that the user opened or if it's part of a package dependency.
34
39
var isPartOfRootPackage : Bool { get }
35
40
@@ -53,6 +58,10 @@ private struct WrappedClangTargetBuildDescription: BuildTarget {
53
58
return description. clangTarget. name
54
59
}
55
60
61
+ public var buildTriple : BuildTriple {
62
+ return description. target. buildTriple
63
+ }
64
+
56
65
public func compileArguments( for fileURL: URL ) throws -> [ String ] {
57
66
let filePath = try resolveSymlinks ( try AbsolutePath ( validating: fileURL. path) )
58
67
let commandLine = try description. emitCommandLine ( for: filePath)
@@ -74,6 +83,10 @@ private struct WrappedSwiftTargetBuildDescription: BuildTarget {
74
83
return description. target. name
75
84
}
76
85
86
+ public var buildTriple : BuildTriple {
87
+ return description. target. buildTriple
88
+ }
89
+
77
90
var sources : [ URL ] {
78
91
return description. sources. map { URL ( fileURLWithPath: $0. pathString) }
79
92
}
0 commit comments