@@ -851,16 +851,6 @@ public final class SwiftTargetBuildDescription {
851
851
try self . fileSystem. writeIfChanged ( path: path, bytes: stream. bytes)
852
852
}
853
853
854
- public static func checkSupportedFrontendFlags( flags: Set < String > , fileSystem: FileSystem ) -> Bool {
855
- do {
856
- let executor = try SPMSwiftDriverExecutor ( resolver: ArgsResolver ( fileSystem: fileSystem) , fileSystem: fileSystem, env: [ : ] )
857
- let driver = try Driver ( args: [ " swiftc " ] , executor: executor)
858
- return driver. supportedFrontendFlags. intersection ( flags) == flags
859
- } catch {
860
- return false
861
- }
862
- }
863
-
864
854
/// The arguments needed to compile this target.
865
855
public func compileArguments( ) throws -> [ String ] {
866
856
var args = [ String] ( )
@@ -1262,7 +1252,7 @@ public final class SwiftTargetBuildDescription {
1262
1252
}
1263
1253
1264
1254
/// The build description for a product.
1265
- public final class ProductBuildDescription {
1255
+ public final class ProductBuildDescription : SPMBuildCore . ProductBuildDescription {
1266
1256
1267
1257
/// The reference to the product.
1268
1258
public let package : ResolvedPackage
@@ -1276,12 +1266,7 @@ public final class ProductBuildDescription {
1276
1266
public let toolsVersion : ToolsVersion
1277
1267
1278
1268
/// The build parameters.
1279
- let buildParameters : BuildParameters
1280
-
1281
- /// The path to the product binary produced.
1282
- public var binary : AbsolutePath {
1283
- return buildParameters. binaryPath ( for: product)
1284
- }
1269
+ public let buildParameters : BuildParameters
1285
1270
1286
1271
/// All object files to link into this product.
1287
1272
///
@@ -1387,12 +1372,12 @@ public final class ProductBuildDescription {
1387
1372
let librarian = buildParameters. toolchain. librarianPath. pathString
1388
1373
let triple = buildParameters. triple
1389
1374
if triple. isWindows ( ) , librarian. hasSuffix ( " link " ) || librarian. hasSuffix ( " link.exe " ) {
1390
- return [ librarian, " /LIB " , " /OUT: \( binary . pathString) " , " @ \( linkFileListPath. pathString) " ]
1375
+ return [ librarian, " /LIB " , " /OUT: \( binaryPath . pathString) " , " @ \( linkFileListPath. pathString) " ]
1391
1376
}
1392
1377
if triple. isDarwin ( ) , librarian. hasSuffix ( " libtool " ) {
1393
- return [ librarian, " -o " , binary . pathString, " @ \( linkFileListPath. pathString) " ]
1378
+ return [ librarian, " -o " , binaryPath . pathString, " @ \( linkFileListPath. pathString) " ]
1394
1379
}
1395
- return [ librarian, " crs " , binary . pathString, " @ \( linkFileListPath. pathString) " ]
1380
+ return [ librarian, " crs " , binaryPath . pathString, " @ \( linkFileListPath. pathString) " ]
1396
1381
}
1397
1382
1398
1383
/// The arguments to link and create this product.
@@ -1416,7 +1401,7 @@ public final class ProductBuildDescription {
1416
1401
}
1417
1402
1418
1403
args += [ " -L " , buildParameters. buildPath. pathString]
1419
- args += [ " -o " , binary . pathString]
1404
+ args += [ " -o " , binaryPath . pathString]
1420
1405
args += [ " -module-name " , product. name. spm_mangledToC99ExtendedIdentifier ( ) ]
1421
1406
args += dylibs. map ( { " -l " + $0. product. name } )
1422
1407
@@ -1639,7 +1624,7 @@ public final class PluginDescription: Codable {
1639
1624
}
1640
1625
1641
1626
/// A build plan for a package graph.
1642
- public class BuildPlan {
1627
+ public class BuildPlan : SPMBuildCore . BuildPlan {
1643
1628
1644
1629
public enum Error : Swift . Error , CustomStringConvertible , Equatable {
1645
1630
/// There is no buildable target in the graph.
@@ -1680,8 +1665,8 @@ public class BuildPlan {
1680
1665
}
1681
1666
1682
1667
/// The products in this plan.
1683
- public var buildProducts : AnySequence < ProductBuildDescription > {
1684
- return AnySequence ( productMap. values)
1668
+ public var buildProducts : AnySequence < SPMBuildCore . ProductBuildDescription > {
1669
+ return AnySequence ( productMap. values. map { $0 as SPMBuildCore . ProductBuildDescription } )
1685
1670
}
1686
1671
1687
1672
/// The results of invoking any build tool plugins used by targets in this build.
@@ -2055,7 +2040,7 @@ public class BuildPlan {
2055
2040
2056
2041
// Plan products.
2057
2042
for buildProduct in buildProducts {
2058
- try plan ( buildProduct)
2043
+ try plan ( buildProduct as! ProductBuildDescription )
2059
2044
}
2060
2045
// FIXME: We need to find out if any product has a target on which it depends
2061
2046
// both static and dynamically and then issue a suitable diagnostic or auto
0 commit comments