This template doesn't require wasi-sdk.
All your need is clang(C language family frontend for LLVM),
lld(wasm-ld from the LLVM project), llvm(llvm-ar tools from the LLVM project)
and tic80 packages.
The advantage of not using wasi-sdk is:
- Won't invoke
WASIapi by mistake, which is not provided bytic80. - No extra dependencies. Have a minimal
libc(modified from wasi-sdk source).
- Clone this template.
- Modify
Makefile, changeTARGET_NAMEto project name. - Compile only the wasm part:
make clean && make wasm - Compile and make the cart:
make clean && make cart - Compile and run the cart:
make clean && DEBUG=1 make run - In order to speed up compiling, static linked library is used.
clean the static library cache:
make cleanlib
printf function have several limitation:
- Not support float and double (%f and %lf).
- Max text length is 80 ascii characters.
math library only have a subset of math functions.
- ms-vscode.cpptools
- ms-vscode.makefile-tools