Browse Source

change "cargo build" to "cargo wasi build".

ZRY 1 month ago
parent
commit
e091939b5e
2 changed files with 16 additions and 1 deletions
  1. 15 0
      docs/ngvfs_docs.typ
  2. 1 1
      testing/standalone-test-0001/justfile

+ 15 - 0
docs/ngvfs_docs.typ

@@ -409,6 +409,21 @@ wpms = "test-init"
 
 提供有用于WASM侧的接口包装Rust Crate。
 
+示例程序在`testing\standalone-test-0001\openngvfs_init_wasm_test`,
+编译该版本建议安装cargo-wasi。
+
+```bash
+cargo install cargo-wasi
+```
+
+可使用如下命令编译init-wasm示例:
+
+```bash
+just wasm
+```
+
+若未安装cargo-wasi请修改justfile内的编译命令。
+
 目前本文档内暂不提供该Crate的文档。
 
 该包的交互式文档可使用rustdoc生成:

+ 1 - 1
testing/standalone-test-0001/justfile

@@ -25,7 +25,7 @@ host_tidy:
 	cd {{host_src}}; go mod tidy -e
 
 wasm:
-	cd {{ wasm_src_root }}; cargo build --target="wasm32-wasi"
+	cd {{ wasm_src_root }}; cargo wasi build
 	cp {{ wasm_src_root / wasm_dist_s_debug / "openngvfs_init_wasm_test.wasm" }} {{ wasm_dist_to_dir / "default.wasm"}}
 
 run: