Skip to content

Adds possibility to use "wallet-wasm" as Rust library, with lto for wasm #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ set +e
git submodule update --init --recursive
pushd wallet-wasm
rustup target add --toolchain ${RUST_TOOLCHAIN} wasm32-unknown-unknown && \
cargo +${RUST_TOOLCHAIN} build --target wasm32-unknown-unknown --release --verbose && \
cargo +${RUST_TOOLCHAIN} build --example wallet_wasm --target wasm32-unknown-unknown --release --verbose && \
popd && \
npm run build
2 changes: 1 addition & 1 deletion js/RustModule.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import loadModule from '../wallet-wasm/target/wasm32-unknown-unknown/release/wallet_wasm.wasm';
import loadModule from '../wallet-wasm/target/wasm32-unknown-unknown/release/examples/wallet_wasm.wasm';

let Module = null;

Expand Down
5 changes: 5 additions & 0 deletions wallet-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ path = "../rust/cardano"
features = [ "generic-serialization" ]

[lib]
crate-type = ["lib"]

[[example]]
name = "wallet_wasm"
path = "src/lib.rs"
crate-type = ["cdylib"]

[profile.release]
Expand Down