Skip to content

Commit 3de3938

Browse files
committed
Add example program that calls calculator functions from hyperlight
Signed-off-by: Mark Rossett <[email protected]>
1 parent 3b36e14 commit 3de3938

File tree

8 files changed

+2316
-1
lines changed

8 files changed

+2316
-1
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"rust-analyzer.linkedProjects": [
33
"components/adder/Cargo.toml",
4-
"components/calculator/Cargo.toml"
4+
"components/calculator/Cargo.toml",
5+
"example/Cargo.toml"
56
]
67
}

Justfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,15 @@ build-component: build-adder build-subtractor build-calculator
1919
# ahead-of-time compile the composed component
2020
hyperlight-wasm-aot compile --component calculator-composed.wasm ./example/calculator-composed.bin
2121

22+
compile-wit:
23+
wasm-tools component wit {{ justfile_directory() }}/example/calculator-composed.wit -w -o {{ justfile_directory() }}/example/calculator-composed-world.wasm
24+
25+
build-example:
26+
cd example && \
27+
HYPERLIGHT_WASM_WORLD={{ justfile_directory() }}/example/calculator-composed-world.wasm \
28+
cargo build
29+
30+
run-example:
31+
cd example && \
32+
HYPERLIGHT_WASM_WORLD={{ justfile_directory() }}/example/calculator-composed-world.wasm \
33+
cargo run

0 commit comments

Comments
 (0)