Skip to content

Commit

Permalink
add a readme and point out incomplete code generation
Browse files Browse the repository at this point in the history
  • Loading branch information
cpetig committed May 20, 2024
1 parent 67b7701 commit 7899b4a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
12 changes: 12 additions & 0 deletions crates/cpp/tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

This folder contains examples on how to use the caninical ABI without
a wasm32 target.

The `native_strings` folder contains an example of passing strings, with
the guest in C++ and Rust, the host in C++, and in the w2c folder an
example of a wasm component transpiled to C and then executed natively.

Sadly the [w2c2](https://github.com/turbolent/w2c2) bridge code generation isn't yet complete.

The `native_resources` folder shows a more complex example using resources,
both guest and host defined ones. This doesn't include a wasm2c deployment.
8 changes: 6 additions & 2 deletions crates/cpp/tests/native_strings/w2c2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,9 @@ valgrind:
w2c2_guest.c: guest_release.wasm
$(W2C2_PATH)/build/w2c2/w2c2 $^ $@

the-world_bridge.c: $(WIT_BINDGEN)
$(WIT_BINDGEN) bridge ../wit --instance guestrelease --include w2c2_guest.h
the-world_bridge.c: the-world_bridge_target.c
cp $^ $@

# not yet up to the task
#the-world_bridge.c: $(WIT_BINDGEN)
# $(WIT_BINDGEN) bridge ../wit --instance guestrelease --include w2c2_guest.h

0 comments on commit 7899b4a

Please sign in to comment.