File tree Expand file tree Collapse file tree 4 files changed +46
-0
lines changed
Sources/Build/BuildDescription Expand file tree Collapse file tree 4 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,11 @@ public final class ClangModuleBuildDescription {
42
42
/// The build parameters.
43
43
let buildParameters : BuildParameters
44
44
45
+ /// The destination for while this module is built.
46
+ public var destination : BuildParameters . Destination {
47
+ self . buildParameters. destination
48
+ }
49
+
45
50
/// The build environment.
46
51
var buildEnvironment : BuildEnvironment {
47
52
buildParameters. buildEnvironment
Original file line number Diff line number Diff line change @@ -121,6 +121,15 @@ public enum ModuleBuildDescription: SPMBuildCore.ModuleBuildDescription {
121
121
}
122
122
}
123
123
124
+ var destination : BuildParameters . Destination {
125
+ switch self {
126
+ case . swift( let buildDescription) :
127
+ buildDescription. destination
128
+ case . clang( let buildDescription) :
129
+ buildDescription. destination
130
+ }
131
+ }
132
+
124
133
var toolsVersion : ToolsVersion {
125
134
switch self {
126
135
case . swift( let buildDescription) :
@@ -139,3 +148,14 @@ public enum ModuleBuildDescription: SPMBuildCore.ModuleBuildDescription {
139
148
}
140
149
}
141
150
}
151
+
152
+ extension ModuleBuildDescription : Identifiable {
153
+ public struct ID : Hashable {
154
+ let moduleID : ResolvedModule . ID
155
+ let destination : BuildParameters . Destination
156
+ }
157
+
158
+ public var id : ID {
159
+ ID ( moduleID: self . module. id, destination: self . destination)
160
+ }
161
+ }
Original file line number Diff line number Diff line change @@ -37,6 +37,11 @@ public final class ProductBuildDescription: SPMBuildCore.ProductBuildDescription
37
37
/// The build parameters.
38
38
public let buildParameters : BuildParameters
39
39
40
+ /// The destination for while this product is built.
41
+ public var destination : BuildParameters . Destination {
42
+ self . buildParameters. destination
43
+ }
44
+
40
45
/// All object files to link into this product.
41
46
///
42
47
// Computed during build planning.
@@ -397,6 +402,17 @@ public final class ProductBuildDescription: SPMBuildCore.ProductBuildDescription
397
402
}
398
403
}
399
404
405
+ extension ProductBuildDescription : Identifiable {
406
+ public struct ID : Hashable {
407
+ let productID : ResolvedProduct . ID
408
+ let destination : BuildParameters . Destination
409
+ }
410
+
411
+ public var id : ID {
412
+ ID ( productID: self . product. id, destination: self . destination)
413
+ }
414
+ }
415
+
400
416
extension SortedArray where Element == AbsolutePath {
401
417
public static func += < S: Sequence > ( lhs: inout SortedArray , rhs: S ) where S. Iterator. Element == AbsolutePath {
402
418
lhs. insert ( contentsOf: rhs)
Original file line number Diff line number Diff line change @@ -49,6 +49,11 @@ public final class SwiftModuleBuildDescription {
49
49
/// The build parameters for this target.
50
50
let buildParameters : BuildParameters
51
51
52
+ /// The destination for while this module is built.
53
+ public var destination : BuildParameters . Destination {
54
+ self . buildParameters. destination
55
+ }
56
+
52
57
/// The build parameters for the macro dependencies of this target.
53
58
let macroBuildParameters : BuildParameters
54
59
You can’t perform that action at this time.
0 commit comments