-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
Consider that we have a lib with conditional compilation:
#[cfg(target_os = "ios")]
pub mod ios_module;
#[cfg(target_os = "macos")]
pub mod mac_module;Now building a framework with:
cargo swift package --accept-all --platforms mac ios --name MyLib --xcframework-name MyLibUniffi --lib-type dynamic
- Only outputs bindings for macOS
- Builds dylib even for iOS!!!
Instead --platforms should be replaced with:
--platform <SINGLE_PLATFORM>
followed by:
--lib-type <THIS_PLATFORM_LIB_TYPE>
In such case it should be possible to build a framework that offers dylib for macOS, and static lib for iOS.
cargo swift package --accept-all --platform mac --lib-type dynamic --platform ios --lib-type static --name MyLib --xcframework-name MyLibUniffi
Swift bindings for iOS and macOS should be included conditionally.
Relevant issue: mozilla/uniffi-rs#2647
Metadata
Metadata
Assignees
Labels
No labels