Skip to content

Commit b4865c4

Browse files
committed
Make uniffi an optional feature
1 parent 3d7c1ec commit b4865c4

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

lib/Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ edition = "2021"
88
crate-type = ["lib", "staticlib", "cdylib"]
99
name = "rust_cktap"
1010

11+
1112
[dependencies]
1213
ciborium = "0.2.0"
1314
serde = "1"
@@ -25,15 +26,16 @@ bitcoin = { version = "0.32", features = ["rand-std"] }
2526
# logging
2627
log = "0.4"
2728

28-
# uniffi todo: make this optional
29-
uniffi = { version = "0.29.1", features = ["cli"] }
29+
# uniffi
30+
uniffi = { version = "0.29", features = ["cli"], optional = true }
3031

3132
pcsc = { version = "2", optional = true }
3233

3334
[build-dependencies]
3435
uniffi = { version = "0.29.1", features = ["build"] }
3536

3637
[features]
38+
uniffi = ["dep:uniffi"]
3739
default = []
3840
emulator = []
3941

lib/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#[cfg(feature = "uniffi")]
12
uniffi::setup_scaffolding!();
23

34
extern crate core;
@@ -13,7 +14,10 @@ pub use bitcoin::secp256k1::{self, rand};
1314

1415
#[cfg(feature = "emulator")]
1516
pub mod emulator;
17+
18+
#[cfg(feature = "uniffi")]
1619
mod ffi;
20+
1721
#[cfg(feature = "pcsc")]
1822
pub mod pcsc;
1923
pub mod sats_card;

0 commit comments

Comments
 (0)