Installing Emscripten using emsdk
emsdk provides an easy way to install, manage, and switch versions of the Emscripten toolchain. emsdk takes care of setting up the environment, tools, and SDK required for compiling C/C++ to LLVM IR and then to JavaScript in the form of asm.js or the WebAssembly binary.
Let's install Emscripten and start hacking:
- Clone the emsdk repo and go into the
emsdk
folder:$ git clone https://github.com/emscripten-core/emsdk $ cd emsdk
- To install emsdk on the machine, run the following command:
For *nix users, use the following:
$ ./emsdk install latest
For Windows users, use the following:
$ emsdk install latest
Note
The preceding command might take a while to run; it will build and set up the entire toolchain.
Next, we will activate the latest emsdk. The activation updates the local shell with the necessary environment references and makes the latest SDK active for the user in the current shell. It writes the...