Emit wasm sections only when compiling to wasm (#8845)

This commit is contained in:
Sergei Shulepov
2021-05-18 14:06:35 +02:00
committed by GitHub
parent 2b8be8cf1e
commit bee5c2dd71
3 changed files with 16 additions and 0 deletions
@@ -238,6 +238,7 @@ fn generate_emit_link_section_decl(contents: &[u8], section_name: &str) -> Token
let len = contents.len();
quote! {
const _: () = {
#[cfg(not(feature = "std"))]
#[link_section = #section_name]
static SECTION_CONTENTS: [u8; #len] = [#(#contents),*];
};