We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
md5: 8924d79e885f93b683c0f26b81c074b5
Issue Description:
In my project, I want to only build an SPM target when the platform I'm building for is not .wasi. For that, I've wrote the following code:
.wasi
// This list should be updated whenever SwiftPM adds support for a new platform. let supportedPlatforms: [Platform] = [ .macOS, .iOS, .watchOS, .tvOS, .linux, .android, .windows, .wasi, ] extension Array where Element: Equatable { func except(_ exceptions: [Element]) -> [Element] { return filter { platform in !exceptions.contains(platform) } } }
I expected that I could write:
.target(name: "WASIIncompatibleTarget", condition: .when(platforms: supportedPlatforms.except([.wasi])))
However, that didn't work because Platform is not Equatable. I see no reason why it shouldn't conform to that protocol, and propose that we fix it.
Platform
Equatable
The text was updated successfully, but these errors were encountered:
@swift-ci create
Sorry, something went wrong.
Resolved in #3018
This was merged and should appear in some future development snapshot.
MaxDesiatov
No branches or pull requests
Additional Detail from JIRA
md5: 8924d79e885f93b683c0f26b81c074b5
Issue Description:
In my project, I want to only build an SPM target when the platform I'm building for is not
.wasi
. For that, I've wrote the following code:I expected that I could write:
However, that didn't work because
Platform
is notEquatable
. I see no reason why it shouldn't conform to that protocol, and propose that we fix it.The text was updated successfully, but these errors were encountered: