Skip to content

Commit

Permalink
add binary, to generate uniffi-bindgen. Might consider re-introducing…
Browse files Browse the repository at this point in the history
… workspace and put it in a separate crate later...
  • Loading branch information
Sajjon committed Feb 14, 2024
1 parent 81571a5 commit b89f942
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ name = "uniffi"
[lib]
crate-type = ["staticlib", "cdylib", "lib"]

[[bin]]
name = "uniffi-bindgen"
path = "src/bin.rs"

[dependencies]
log = "0.4.20"
pretty_env_logger = "0.5.0"
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fat_simulator_lib_dir="target/ios-simulator-fat/release"

generate_ffi() {
echo "Generating framework module mapping and FFI bindings"
cargo run -p uniffi-bindgen generate --library target/aarch64-apple-ios/release/lib$1.dylib --language swift --out-dir target/uniffi-xcframework-staging
cargo run --bin uniffi-bindgen generate --library target/aarch64-apple-ios/release/lib$1.dylib --language swift --out-dir target/uniffi-xcframework-staging
mkdir -p ../apple/Sources/UniFFI/
mv target/uniffi-xcframework-staging/*.swift ../apple/Sources/UniFFI/
mv target/uniffi-xcframework-staging/$1FFI.modulemap target/uniffi-xcframework-staging/module.modulemap # Convention requires this have a specific name
Expand Down
4 changes: 4 additions & 0 deletions src/bin.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fn main() {
println!("🔮 Running uniffi-bindgen");
uniffi::uniffi_bindgen_main()
}

0 comments on commit b89f942

Please sign in to comment.