Hi, thanks for contributing! If you just want to use the SDK, it's recommended you use the prebuilt binaries in releases, as documented in the README. If you want to build from source, you've come to the right place.
rustc@1.86.0+cargo(userustupto install/manage)wasi-sdk, version25.0[note]cmakeandmake(likely installed through your package manager)doxygen(optional. Only if you want to build documentation)just(optional. Seejustfilefor equivalent commands to the ones documented below.)
wasi-sdk-25.0 is only compatible with rustc versions up to 1.86.0. If you
use 1.87.0 or later, you'll need to use a higher wasi-sdk version. If
building this project manually, you must make sure that the version of
wasi-sdk version you're using has an equal or greater LLVM version than the
one used by your rustc.
The build script assumes you're installing wasi-sdk to /opt/wasi-sdk. You
can specify a custom path using --set wasi-sdk /path/to/wasi-sdk-dist in
just, or by supplying the relevant wasi-sdk-p1.cmake file with -DCMAKE_TOOLCHAIN_FILE if using CMake directly.
You can run the examples directly using just, if you have all the above set up.
To run the "hello world" example (see ./examples/echo.cpp), you can use:
just exampleTo run any other examples, you can use:
just example example-nameWhere example-name will refer to a corresponding example-name.cpp in the
examples/ directory. Every example will have appropriate links and
explanations to what it's doing.
justjust --set type Debugjust --set wasi-sdk /path/to/your/wasi-sdk-XX.Yjust docs