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
@@ -675,6 +675,7 @@ fn generate_runtime_api_versions(impls: &[ItemImpl]) -> Result<TokenStream> {
#( #attrs )*
const _: () = {
// All sections with the same name are going to be merged by concatenation.
#[cfg(not(feature = "std"))]
#[link_section = "runtime_apis"]
static SECTION_CONTENTS: [u8; 12] = #c::serialize_runtime_api_info(#id, #version);
};