Skip to content

Commit 01d3563

Browse files
committed
fix(ffi): exclude nodedb-lite-ffi from wasm32 targets
Gate the crate's dependencies under `[target.'cfg(not(target_arch = "wasm32"))'.dependencies]` and add a top-level `#![cfg(not(target_arch = "wasm32"))]` attribute so the FFI crate is a no-op when the workspace is compiled for `wasm32-unknown-unknown`. This prevents C/JNI symbols from being pulled into the WASM build, which has no use for them.
1 parent b72df15 commit 01d3563

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

nodedb-lite-ffi/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ homepage.workspace = true
1212
[lib]
1313
crate-type = ["lib", "staticlib", "cdylib"]
1414

15-
[dependencies]
15+
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
1616
nodedb-lite = { workspace = true }
1717
nodedb-client = { workspace = true }
1818
nodedb-types = { workspace = true }

nodedb-lite-ffi/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//! C FFI bindings for NodeDB-Lite.
2+
#![cfg(not(target_arch = "wasm32"))]
23
//!
34
//! Exposes the `NodeDb` trait as C-callable functions for Swift (iOS)
45
//! and Kotlin/JNI (Android) interop.

0 commit comments

Comments
 (0)