Skip to content

Commit a18182a

Browse files
committed
code cleanup
1 parent 3f281fb commit a18182a

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

Sources/SwiftBuildSupport/PIFBuilder.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,14 +362,14 @@ fileprivate func buildAggregateProject(
362362
// conflicts with those from "PACKAGE-TARGET:Foo-dynamic".
363363
continue
364364
}
365-
/*
365+
366366
if let resolvedModule = modulesGraph.module(for: target.name) {
367367
guard modulesGraph.isInRootPackages(resolvedModule, satisfying: buildParameters.buildEnvironment) else {
368368
// Disconnected target, possibly due to platform when condition that isn't satisfied
369369
continue
370370
}
371371
}
372-
*/
372+
373373
aggregateProject[keyPath: allIncludingTestsTargetKeyPath].common.addDependency(
374374
on: target.id,
375375
platformFilters: [],

Sources/SwiftBuildSupport/PackagePIFBuilder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ public final class PackagePIFBuilder {
504504
for machoPlatform in [ProjectModel.BuildSettings.Platform.macOS, .macCatalyst, .iOS, .watchOS, .tvOS, .xrOS, .driverKit] {
505505
settings.platformSpecificSettings[machoPlatform]![.DYLIB_INSTALL_NAME_BASE]! = ["@rpath"]
506506
}
507-
for elfPlatform in [ProjectModel.BuildSettings.Platform.linux, .android] {
507+
for elfPlatform in [ProjectModel.BuildSettings.Platform.linux, .android, .openbsd, .freebsd] {
508508
// FIXME: Treating $ORIGIN as part of the soname is not really the right thing to do here
509509
settings.platformSpecificSettings[elfPlatform]![.DYLIB_INSTALL_NAME_BASE]! = ["$ORIGIN"]
510510
}

Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Products.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
import Foundation
14+
import TSCBasic
1415
import TSCUtility
1516

1617
import struct Basics.AbsolutePath
@@ -1010,7 +1011,7 @@ extension PackagePIFProjectBuilder {
10101011
}
10111012

10121013
guard let unitTestModuleName = unitTestProduct.moduleName else {
1013-
fatalError()//throw StringError("")
1014+
throw StringError("Unit test product '\(unitTestProduct.name)' is missing a module name")
10141015
}
10151016

10161017
let name = "\(unitTestProduct.name)-test-runner"
@@ -1058,7 +1059,7 @@ extension PackagePIFProjectBuilder {
10581059
}
10591060

10601061
guard let unitTestGUID = unitTestProduct.pifTarget?.id else {
1061-
fatalError()
1062+
throw StringError("Unit test product '\(unitTestProduct.name)' is missing a PIF GUID")
10621063
}
10631064
self.project[keyPath: testRunnerTargetKeyPath].common.addDependency(
10641065
on: unitTestGUID,

0 commit comments

Comments
 (0)