Make sure you actually activate the emsdk. Further, use the bash scripts for the initial build directory CMake call, as they set up things like the toolchain file for the web build (e.g. call script/cmake_emscripten.sh WebBuild
for that initial build). I got it working with emscripten 2.0.12, though I’m not sure how old that is. To do that, though, I had to manually specify the EMSCRIPTEN_ROOT_PATH as the later versions of emscripten don’t set one of the environment variables we were using previously (I think that is the cause at least). So for example, I call
rm -r WebBuild; EMSCRIPTEN_ROOT_PATH=~/tools/emsdk/upstream/emscripten URHO3D_HOME=~/builds/Urho3D/WebBuild/ script/cmake_emscripten.sh WebBuild
from my project directory, and it would be similar for the library build itself except without the URHO3D_HOME
specification. The rm -r WebBuild is because I ended up getting parts of it wrong a lot, and you need to start from a clean directory each time with a lot of the errors in setting a compiler (because of some particularity of CMake, I think).
After the initial successful generation, you should be able to modify most things (like Debug or Release builds and such) directly through cmake without calling the scripts, as the relevant parts will have been saved to the CMakeCache.txt file by CMake.
As to the documentation, I think it’s generally pretty good for how to build the library, with the exception of the emscripten build, which is rather sparse in the details.
Also, for the web build, if you build the samples/tools you should get an html file (and js and wasm and pak files) in the WebBuild/bin directory, rather than regular executables (as a better check than file size, if you ask me).