Created
September 6, 2021 10:09
-
-
Save ryanking13/5e0e0d36a60ed947b94286e82b4a40d7 to your computer and use it in GitHub Desktop.
Emscripten side_module test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int side(); | |
| int main() { | |
| side(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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