Skip to content

Commit

Permalink
joinstr_wallet: automatically generate C/C++ bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
pythcoiner committed Feb 23, 2025
1 parent 8282aac commit 07213e4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
/dart/android/
/dart/lib/
/rust/joinstr/include
/rust/joinstr_wallet/include
Cargo.lock
12 changes: 10 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ binding:

clean:
rm -fRd target
rm -fRd rust/joinstr/include/c
rm -fRd rust/joinstr/include/cpp
rm -fRd rust/joinstr/include/*
rm -fRd rust/joinstr_wallet/include/*
rm -fRd dart/lib/joinstr.dart
rm -fRd dart/android
rm -fRd dart/ios
Expand All @@ -18,3 +18,11 @@ lint:
test:
just lint
cargo test -- --nocapture

wallet:
cbindgen --lang c --crate joinstr_wallet -o rust/joinstr_wallet/include/c/joinstr.h
cbindgen --crate joinstr_wallet -o rust/joinstr_wallet/include/cpp/joinstr.h
cargo build -p joinstr_wallet --release
cp target/release/libjoinstr_wallet.a rust/joinstr_wallet/include/libjoinstr_wallet.a
cp target/release/libjoinstr_wallet.d rust/joinstr_wallet/include/libjoinstr_wallet.d
cp target/release/libjoinstr_wallet.so rust/joinstr_wallet/include/libjoinstr_wallet.so

0 comments on commit 07213e4

Please sign in to comment.