Closed wooden-worm closed 1 month ago
Yeah, this is not ideal.
The goal is eventually to have the header translator that generates the Rust code from the Objective-C framework headers do a platform-specific analysis (e.g., for macOS
vs iOS
vs watchOS
, ...) that would catch this sort of thing and only expose the correct features and sub-modules per-platform.
But right now that functionality is not really implemented and the actual backend logic for the translator is in the process of moving to a new, more robust approach, so it may be awhile before that functionality lands (probably at least another month or two, and that may be optimistic).
You can read a little about it here:
A one-off fix to address this specific case might be possible but the difficulty is in maintaining that change throughout the header generation process. There isn't really tool support for that now so it would have to be re-implemented by hand each time the generator is re-run.
Probably the most practical solution at the moment would be to maintain a local fork of your own with those changes that you need and then you could rebase your fork on top of whatever updates are released through icrate
as needed.
Hopefully it will be possible to handle this more directly once the new binding generator starts to become usable.
Any updates here?
https://github.com/madsmtm/objc2/pull/592, which will hopefully land soon, will fix this by making the AppKit dependency optional
592, which will hopefully land soon, will fix this by making the AppKit dependency optional
Awesome, thank you
I'm trying to use
icrate
on iOS. My goals are simple: showing IAPs and allowing users to purchase them. However,icrate
withStoreKit
feature fails to build for iOS due to its dependency onAppKit
https://github.com/madsmtm/objc2/blob/3d9b6864af05592fc18b1ab27b3da9ed3896bc53/crates/icrate/Cargo.toml#L4582C1-L4585C2Proposal: remove the dependency on
AppKit
. Users who need it can easily enableAppKit
.