Skip to content

Example of the C API to embed the Wasmer runtime

Notifications You must be signed in to change notification settings

karlbom/wasmer-c-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Example of the C API to embed the Wasmer runtime

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 83.2%
  • CMake 16.8%