mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-28 07:51:07 +00:00
Only emit static descriptors on wasm (#554)
This is a bit of a refinement of the solution from #548 to make sure that these statics are only present on the `wasm32-*` targets, as otherwise these descriptors are completely inert on other platforms!
This commit is contained in:
parent
61fc8d2567
commit
19acb5bb72
@ -76,7 +76,8 @@ impl ToTokens for ast::Program {
|
|||||||
|
|
||||||
(quote! {
|
(quote! {
|
||||||
#[allow(non_upper_case_globals)]
|
#[allow(non_upper_case_globals)]
|
||||||
#[link_section = "__wasm_bindgen,unstable"]
|
#[cfg(target_arch = "wasm32")]
|
||||||
|
#[link_section = "__wasm_bindgen_unstable"]
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub static #generated_static_name: [u8; #generated_static_length] =
|
pub static #generated_static_name: [u8; #generated_static_length] =
|
||||||
*#generated_static_value;
|
*#generated_static_value;
|
||||||
|
@ -287,7 +287,7 @@ fn extract_programs(module: &mut Module) -> Result<Vec<shared::Program>, Error>
|
|||||||
Section::Custom(ref s) => s,
|
Section::Custom(ref s) => s,
|
||||||
_ => continue,
|
_ => continue,
|
||||||
};
|
};
|
||||||
if custom.name() != "__wasm_bindgen,unstable" {
|
if custom.name() != "__wasm_bindgen_unstable" {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
to_remove.push(i);
|
to_remove.push(i);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user