M3/Wasm project uses CMake. It can also be easily integarted into any build system. General build steps look like:
mkdir -p build
cd build
cmake ..
make -j8
It's recommended to use Clang/Ninja to build the project.
Note: When using GCC or Microsoft C++ Compiler, all .c
files are forced to be comiled as C++
to eliminate some errors.
Currently, support for these compilers was added for evaluation purposes.
mkdir -p build
cd build
cmake -GNinja -DCLANG_SUFFIX="-9" ..
ninja
cmake -GNinja ..
ninja
Prerequisites:
Recommended tools:
REM Prepare environment (if needed):
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
set PATH=C:\Program Files\CMake\bin;%PATH%
set PATH=C:\Program Files\LLVM\bin;%PATH%
set PATH=C:\Python36-32\;C:\Python36-32\Scripts\;%PATH%
mkdir build
cd build
cmake -GNinja -DCLANG_CL=1 ..
ninja
cmake -G"Visual Studio 16 2019" -A x64 -T ClangCL ..
MSBuild /p:Configuration=Release wasm3.sln
cmake -G"Visual Studio 16 2019" -A x64 ..
MSBuild /p:Configuration=Release wasm3.sln
cmake -GNinja ..
ninja
In ./platforms/
folder you can find projects for different targets. Some of them are using Platformio, so you can follow the regular pio build process. Others have custom instructions in respective README.md
files.
To run spec tests, you need python3
and WABT
(The WebAssembly Binary Toolkit).
cd test
python3 ./run-spec-test.py
It will automatically download, extract, preprocess the WebAssembly core test suite.