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

This commit is contained in:
Sergei Shulepov authored and GitHub committed 2021-05-18 12:06:35 +00:00
1 parent 2b8be8cf1e
commit bee5c2dd71
3 files changed
+16

No files matched your search

@@ -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),*];
};