Hello world example with webassembly and CMake
- Setup emscripten (including
source ./emsdk_env.sh
) - run
./build.sh
The output wil then be in ./dist
The resulting files can be served by a http server, for exampke http-server.
cd dist && http-server .
Opening the hosted files (in my case at http://127.0.0.1:8080) and viewing the Console gives:
prerun
From app: Opening file: /input.txt
From app: File opened
From app: /input.txt: Hello webassembly
From app: Opening file: /not-existing-file.abc
From app: Could not open file.
From app: usage: ./this.program path