wasm-micro-runtime/samples/wasm-c-api
Wenyong Huang 89d2937cde
Refactor app heap and memory boundary check, and fix os_printf compilation error (#356)
Insert app heap before __heap_base, or before new page
Fix os_printf compilation error in some platforms
2020-08-20 12:43:12 +08:00
..
src Refactor app heap and memory boundary check, and fix os_printf compilation error (#356) 2020-08-20 12:43:12 +08:00
CMakeLists.txt Eable post-MVP feature wasm-c-api (#315) 2020-07-23 16:54:13 +08:00
README.md Eable post-MVP feature wasm-c-api (#315) 2020-07-23 16:54:13 +08:00

WAMR supports wasm-c-api in both interpreter mode and aot mode. By default, all samples are compiled and run in "interpreter" mode.

$ mkdir build
$ cd build
$ cmake ..
$ make
$ # it will build a library with c-api supporting.
$ # Also copy *.wasm from ../src/
$ # and generate executable files
$ # now, it is ok to run samples
$ ./hello
$ ...
$ ./global
$ ...
$ ./callback
$ ...

They can be compiled and run in aot mode when some compiling flags are given.

$ mkdir build
$ cd build
$ cmake -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_AOT=1 ..
$ make
$ # it will build a library with c-api supporting.
$ # Also copy *.wasm from ../src/
$ # and transform *.wasm to *.aot
$ # and generate executable files
$ # now, it is ok to run samples
$ ./hello
$ ...
$ ./global
$ ...
$ ./callback
$ ...