iOS/tvOS/watchOS/visionOS support in framework crates #408
Labels
A-framework
Affects the framework crates and the translator for them
help wanted
Extra attention is needed
Milestone
My plan was to do something like:
header-translator
(e.g.main.rs::parse_sdk
) for each platformavailability
attribute that will end up adding acfg
attribute on itHashMap
with "top-level" information (name of stmt, which generics a class has, and so on (but not which methods a class has implemented))cfg
attributes (ideally in the same order as the input file)The result is that we would only have to distribute one crate, and that crate would have the correct
cfg
attributes, which is very useful for the documentation on docs.rs (since it could directly show us which things are available on which platforms).As an example, let's take
NSPointerArray
: On this, there are five methods on macOS, and three on iOS,pointerArrayWithStrongObjects
andpointerArrayWithWeakObjects
are only available on iOS. So the result we'd like is that these two got a#[cfg(target_os = "macos")]
on them.All of this is the ideal solution; before we get there though, we're going to be doing a bunch of hacks, #600 contains an example of one of these.
The text was updated successfully, but these errors were encountered: