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