Skip to content

Commit c846501

Browse files
committed
Align with SWIFTPM_MACOS_DEPLOYMENT_TARGET if set
In certain build contexts, it can be necessary to align the swift-driver deployment target with the one specified for SwiftPM via this environment variable.
1 parent cb5b81a commit c846501

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Package.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@
22
import PackageDescription
33
import class Foundation.ProcessInfo
44

5+
let macOSPlatform: SupportedPlatform
6+
if let deploymentTarget = ProcessInfo.processInfo.environment["SWIFTPM_MACOS_DEPLOYMENT_TARGET"] {
7+
macOSPlatform = .macOS(deploymentTarget)
8+
} else {
9+
macOSPlatform = .macOS(.v10_10)
10+
}
11+
512
let package = Package(
613
name: "swift-driver",
714
platforms: [
8-
.macOS(.v10_10),
15+
macOSPlatform,
916
],
1017
products: [
1118
.executable(

0 commit comments

Comments
 (0)