main
CWasm
A minimal layer for compiling C applications that render graphics through WebGL from a WebAssembly module using Clang (not Emscripten)
Compilation
CWasm is compiled with the applicaiton as a Unity Build. The application's main source file must #include cwasm.c before anything else. The code in this repository is only tested with Clang as the compiler and wasm32-unknown-unknown as the target architecture. You must have a version of Clang that supports compiling to WebAssembly.
- Install Clang (LLVM's Compiler) from LLVM's Download Page
- Make sure Clang is available from the command-line by doing
clang -v. If it's not, make sure you update yourPATHenvironment variable to include thebin/folder of the LLVM install directory - Ensure you have Clang 11.0 or greater for proper WebAssembly support (we recommend using the latest, that's v18.1.8 as this is written)
- On Windows run the
build.bat [path/to/app.c]. On Linux or OSX run thebuild.sh [path/to/app.c]. If compiling CWasm without a real application the app.c argument may be ommitted and test_app.c will be used instead.
Languages
C
94.4%
JavaScript
5.2%
Batchfile
0.2%