Skip to content

Instantly share code, notes, and snippets.

@ryanking13
Created September 6, 2021 10:09
Show Gist options
  • Select an option

  • Save ryanking13/5e0e0d36a60ed947b94286e82b4a40d7 to your computer and use it in GitHub Desktop.

Select an option

Save ryanking13/5e0e0d36a60ed947b94286e82b4a40d7 to your computer and use it in GitHub Desktop.
Emscripten side_module test
emcc side.c -s SIDE_MODULE=1 -o side.wasm -s EXPORT_ALL=1
emcc main.c side.wasm -s MAIN_MODULE=1 -s EXPORT_ALL=1 -o main.js
# node main.js
int side();
int main() {
side();
}
#include <stdio.h>
int side() {
printf("hello from side module\n");
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment