/wasmer-c-api

The C api for the Wasmer runtime

Primary LanguageC

C-API Embedder App Example

This repo showcases how to use the wasmer-runtime-c-api from C, based on the blogpost:

See wasmer-c-api-example.c for the example implementation.

The wasm-sample-app directory contains an example C wasm app to run in the embedder app.

Requirements

  • CMake
  • Emscripten to build the sample app

Building & Running

# Building the wasm-sample-app
cd wasm-sample-app && emcc source.c  -Os -s SIDE_MODULE=1 -s EXPORTED_FUNCTIONS="['_hello_wasm']" -o target.wasm

# Build the embedder api
cmake .
make

# Run the executable
./wasmer-c-api-example