create-exe: fix serialized create-exe not working

Unified generated objects interfaces: both static and serialized objects
expose the same function signature to create the module:

  wasm_module_t* wasmer_object_module_new(wasm_store_t* store, const char* module_name);
This commit is contained in:
Manos Pitsidianakis
2022-08-18 13:50:40 +03:00
parent f8ad896512
commit 306347e1b9
6 changed files with 54 additions and 248 deletions

View File

@@ -15,7 +15,7 @@ use std::process::Command;
use wasmer::*;
use wasmer_object::{emit_serialized, get_object_for_target};
const WASMER_SERIALIZED_HEADER: &[u8] = include_bytes!("wasmer_create_exe.h");
const WASMER_SERIALIZED_HEADER: &[u8] = include_bytes!("wasmer_deserialize_module.h");
#[derive(Debug, Parser)]
/// The options for the `wasmer create-exe` subcommand
@@ -152,6 +152,16 @@ impl CreateObj {
self.output.display(),
header_output.display(),
);
eprintln!("\n---\n");
eprintln!(
r#"To use, link the object file to your executable and call the `wasmer_object_module_new` function defined in the header file. For example, in the C language:
#include "{}"
wasm_module_t *module = wasmer_object_module_new(store, "my_module_name");
"#,
header_output.display(),
);
Ok(())
}