Skip to content
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

Add support for adding this lib to multi-platform targets #145

Merged
merged 2 commits into from
May 31, 2024

Conversation

Jeehut
Copy link
Contributor

@Jeehut Jeehut commented May 24, 2024

I'm working on a new app that is available on all Apple platforms. But only on iOS I want to use this library to securely transfer some credentials from the Mac app to the iPhone app. But due to limitations in SwiftPM or Xcodes build system, it's not possible to include this package to a multi-platform project and just to link it when building for iOS. I'd need to create multiple targets to do that, which I don't want to do as it's a SwiftUI app and I like to keep things simple & clean.

This PR adds building support for other Apple platforms by specifying compatibility in the Package manifest while basically commenting out all code when those platforms are targeted during a build.

I'd understand if you don't want to merge this. But I needed it, so I figured maybe others may need it as well.
Thank you for providing this great lib, it was a huge time saver!

@twostraws
Copy link
Owner

Thank you! This mostly looks good, but why the bump to Swift tools 5.9?

@Jeehut
Copy link
Contributor Author

Jeehut commented May 31, 2024

@twostraws Because I can't specify the platform .visionOS(.v1) in earlier versions, the compiler says it doesn't know what visionOS is in earlier Swift. Or maybe I'm doing something wrong? 🤷‍♂️

@twostraws
Copy link
Owner

Hmm. This seems like a bigger change, then. @nathanfallet: do you have any views on this? At least 5.9 isn't the newest

@nathanfallet
Copy link
Collaborator

nathanfallet commented May 31, 2024

I'm going to take a look, we had a lot of issues we solved at SQLite.swift regarding visionOS, so I should be able to find how to make it work
EDIT: It looks fine to me about the Package.swift itself, the older build tool doesn't know about visionOS so there is no other choice to update.

@nathanfallet nathanfallet merged commit 23e9b6e into twostraws:main May 31, 2024
1 check passed
@GayleDDS
Copy link

GayleDDS commented Jun 9, 2024

Couldn't you use #if compiler(>=5.9) for the vision stuff and not update swift-tools-version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants