-
Notifications
You must be signed in to change notification settings - Fork 0
Home
-
Make sure the code is C99 compatible
-
Implicit function definitions aren't supported so add function declarations
-
Fix all other compiler warnings
-
-
Can just change
CC
from whatever it is (e.g.cc
orgcc
) toemcc
. This results in files with the names of the original binaries, but are actually object files -
Link/rename this file and turn it into wasm using
emcc
, e.g. -
multiple spaces are displayed as one in html (have to convert to  )
-
There are 2 main methods of Packaging Files
-
Compile time packaging: Useful for including static files. More information here
-
Runtime file inclusion: Useful for letting user upload files during runtime.
-
First, get the files using an HTML input field
-
Base64 encode the file. Example here
-
Use the FS_createDataFile function to add the file to the module before running it
-
-
ln -s decodeanhmm decodeanhmm.o && emcc decodeanhmm.o -o project.html
-
https://developer.mozilla.org/en-US/docs/WebAssembly/C_to_wasm
-
Providing command line args to a wasm program
https://softwareengineering.stackexchange.com/a/329626/246842
-
Writing temporary files
https://developer.mozilla.org/en-US/docs/Web/API/FileSystem#Browser_compatibility
linked to from here: https://stackoverflow.com/questions/53480465/write-to-file-within-webassembly