-
Notifications
You must be signed in to change notification settings - Fork 129
Add support for visionOS #152
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
Conversation
|
I would prefer to do this by setting a compilation variable in the package manifest. This |
|
Perhaps something like swiftSettings: [
.define("APPLE", .when(platforms: [Platform.macOS, Platform.iOS, Platform.watchOS, Platform.tvOS, Platform.visionOS])),in the package manifest? |
If you do go this route, note that Apple has non Darwin uses of Swift such as the triple: You could name this define |
73de625 to
dda06cd
Compare
glessard
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thanks for helping with this!
|
@swift-ci please test |
|
The testing failure involves a change in Swift 6.0. Will need to fix this separately. |
|
@noahpistilli I think the approach is good, but the symbol "DARWIN" may be a bit too prone to collisions, given that it could possibly be passed from the command-line by any package that uses this. May I suggest something less likely have collisions, such as "SYSTEM_PACKAGE_DARWIN"? |
|
@swift-ci please test |
|
Wouldn't it be better to use Especially since a lot of these are literally guarding imports of the |
This seems abundantly obvious now that you say it... |
|
@swift-ci please test |
|
|
It’s only an issue if this package were to introduce a dependency on another package named “Darwin”, or if a third-party toolchain were to include a Swift module named “Darwin” in its standard installation. That’s sufficiently unlikely that I don’t think it needs to be a concern. Such a toolchain would quickly encounter widespread problems across the Swift ecosystem and would likely choose a different name. Importantly, the official toolchain would not encounter issues when building for Apple platforms. That’s the only thing I think we need to be concerned about right now. |
Adds compilation support for visionOS. All tests pass. Closes #150.
I was unsure if I had to edit
Utilities/expand-availability.py, so I didn't touch it.