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:
Alex Crichton
2018-07-25 16:56:27 -05:00
committed by GitHub
parent 61fc8d2567
commit 19acb5bb72
2 changed files with 3 additions and 2 deletions

View File

@ -76,7 +76,8 @@ impl ToTokens for ast::Program {
(quote! {
#[allow(non_upper_case_globals)]
#[link_section = "__wasm_bindgen,unstable"]
#[cfg(target_arch = "wasm32")]
#[link_section = "__wasm_bindgen_unstable"]
#[doc(hidden)]
pub static #generated_static_name: [u8; #generated_static_length] =
*#generated_static_value;