Repository navigation
[Proposal] Deployment target conditional compilation - #3478
Conversation
|
|
||
| ## Proposed solution | ||
|
|
||
| Introduce `deploymentTargetAtLeast(...)` as a condition accepted by `#if`: |
There was a problem hiding this comment.
There's some question as to whether this terminology would be best aligned with existing usage as minDeploymentTarget, and/or if there might be confusion with "target" as it's used in SwiftPM and whether the use of "deployment" here breaks new ground within Swift itself. But this can all be discussed during review, so no need to hash it out at this point.
|
Thanks for the review. I've pushed an update. I fixed the wildcard wording and removed the trailing comma sentence, along with the For platform matching, a requirement now applies only when its platform names the target, with the most specific one winning when several match. I've written out where this differs from The Linux case also explains why it's diagnosed. Happy to revisit the spelling during review. |
3385501 to
56301e9
Compare
|
Great! Sorry last thing: would you mind creating pull requests against main with your prototypes. They can stay in draft mode and won't be merged as-is, but this would allow us to build test toolchains for people to try out. But I agree the proposal text looks ready! Thanks so much |
|
Thanks! I’ve opened draft PRs against |
This proposal introduces
#if deploymentTargetAtLeast(...), a conditional compilation condition based on the minimum deployment target of the module being compiled.Pitch discussion: https://forums.swift.org/t/pitch-conditional-compilation-for-the-deployment-target/89282
Prototype implementations: