mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-08 13:48:26 +00:00
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:
@@ -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(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user