Skip to content

Commit 01dc43f

Browse files
authored
Add --return-call-ref option (#119)
1 parent 8354925 commit 01dc43f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,10 @@ struct ComponentLdArgs {
340340
/// not already recognized by this wrapper executable.
341341
#[clap(long)]
342342
append_lld_flag: Vec<OsString>,
343+
344+
/// Whether or not to use `return_call_ref` in the generated component.
345+
#[clap(long)]
346+
return_call_ref: bool,
343347
}
344348

345349
fn parse_adapter(s: &str) -> Result<(String, Vec<u8>)> {
@@ -698,7 +702,8 @@ impl App {
698702
let mut encoder = wit_component::ComponentEncoder::default();
699703
encoder
700704
.reject_legacy_names(self.component.reject_legacy_names)
701-
.realloc_via_memory_grow(self.component.realloc_via_memory_grow);
705+
.realloc_via_memory_grow(self.component.realloc_via_memory_grow)
706+
.shim_return_call_ref(self.component.return_call_ref);
702707
if let Some(validate) = self.component.validate_component {
703708
encoder.validate(validate.unwrap_or(true));
704709
}

0 commit comments

Comments
 (0)