Skip to content

[5.5] Respect SWIFT_TOOLCHAIN_MACOS_DEPLOYMENT_TARGET when set (such as during Swift toolchain build) #224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
This source file is part of the Swift.org open source project

Copyright (c) 2019 - 2020 Apple Inc. and the Swift project authors
Copyright (c) 2019 - 2021 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See http://swift.org/LICENSE.txt for license information
Expand All @@ -12,9 +12,20 @@


import PackageDescription
import class Foundation.ProcessInfo

let macOSPlatform: SupportedPlatform
if let deploymentTarget = ProcessInfo.processInfo.environment["SWIFT_TOOLCHAIN_MACOS_DEPLOYMENT_TARGET"] {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abertelrud are we also changing SwiftPM to use this instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's the plan, although this needs to be coordinated with @shahmishal. But I can put up a SwiftPM and SwiftDriver change to favour SWIFT_TOOLCHAIN_MACOS_DEPLOYMENT_TARGET and for now falling back on SWIFTPM_MACOS_DEPLOYMENT_TARGET until the new one is set in toolchain builds.

macOSPlatform = .macOS(deploymentTarget)
} else {
macOSPlatform = .macOS(.v10_10)
}

let package = Package(
name: "swift-tools-support-core",
platforms: [
macOSPlatform,
],
products: [
.library(
name: "SwiftToolsSupport",
Expand Down