Skip to content

Commit

Permalink
Add Swift bindings generation support
Browse files Browse the repository at this point in the history
  • Loading branch information
tnull committed May 8, 2023
1 parent 80664de commit 0126e67
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/uniffi_bindgen_generate.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash
source ./scripts/uniffi_bindgen_generate_kotlin.sh
source ./scripts/uniffi_bindgen_generate_python.sh
source ./scripts/uniffi_bindgen_generate_swift.sh

10 changes: 10 additions & 0 deletions scripts/uniffi_bindgen_generate_swift.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
BINDINGS_DIR="./bindings/swift"
UNIFFI_BINDGEN_BIN="cargo run --features=uniffi/cli --bin uniffi-bindgen"

cargo build --release
$UNIFFI_BINDGEN_BIN generate bindings/ldk_node.udl --language swift -o "$BINDINGS_DIR"

mkdir -p $BINDINGS_DIR

swiftc -module-name ldk_node -emit-library -o "$BINDINGS_DIR"/libldk_node.dylib -emit-module -emit-module-path "$BINDINGS_DIR" -parse-as-library -L ./target/release -lldk_node -Xcc -fmodule-map-file="$BINDINGS_DIR"/ldk_nodeFFI.modulemap "$BINDINGS_DIR"/ldk_node.swift -v

0 comments on commit 0126e67

Please sign in to comment.