Skip to content

Commit edb7a0f

Browse files
Daniel Salinaspoljar
authored andcommitted
Add Wasm platform aware test to export proc-macro
1 parent 0f73ffd commit edb7a0f

File tree

1 file changed

+6
-1
lines changed
  • bindings/matrix-sdk-ffi-macros/src

1 file changed

+6
-1
lines changed

bindings/matrix-sdk-ffi-macros/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ pub fn export(attr: TokenStream, item: TokenStream) -> TokenStream {
5151

5252
let res = match syn::parse(item) {
5353
Ok(item) => match has_async_fn(item) {
54-
true => quote! { #[uniffi::export(async_runtime = "tokio", #attr2)] },
54+
true => {
55+
quote! {
56+
#[cfg_attr(target_family = "wasm", uniffi::export(#attr2))]
57+
#[cfg_attr(not(target_family = "wasm"), uniffi::export(async_runtime = "tokio", #attr2))]
58+
}
59+
}
5560
false => quote! { #[uniffi::export(#attr2)] },
5661
},
5762
Err(e) => e.into_compile_error(),

0 commit comments

Comments
 (0)