Setting up Emscripten with CMake on Linux
All notes in this series:
- Setting up Emscripten with CMake in Git Bash on Windows 10
- Setting up Emscripten with CMake on Linux
- Porting a simple SDL2 game to Emscripten
- Setting up CMocka with CMake for Linux and Windows
Setting up Emscripten with CMake on Linux is largely the same as the earlier instructions for Setting up Emscripten with CMake in Git Bash on Windows 10. The steps about creating Python aliases can be skipped, since they only apply to Git Bash. The rest is then the same, since using Git Bash means we can use the Linux commands.
As a quick refresher, assuming you have a git repository with emsdk as a submodule, the steps for getting started on Linux are as follows:
Ensure the emsdk submodule is up-to-date §
Install and activate emsdk §
Perform the build §
As before, each time you open a new shell, you will need to source ./emsdk_env.sh
so that tools such as emcc
and emcmake
are on the path.
Then you can build the project as follows: