You probably have to disable several features of 3.1.6 to allow for a successful WASM build.
For example in CMakeLists.txt, the options to build examples, simulate library, and tests for MuJoCo have been turned off by default (changed from ON to OFF). New configurations and target properties for building MuJoCo with Emscripten have been added. This includes defining source files, checking their existence, and setting specific properties and options for building WebAssembly (.wasm) and HTML output. Some target link options have been adjusted, including removing the lodepng library from the target link list.
For Also, for example in CMakeListsmjxmacro.txt, the options h you have to involve adding explicit casting to build examples, simulate library, and tests size_t for MuJoCo have been turned off by default (changed from ON to OFF). New configurations the calculations of key_mpos and target properties for building MuJoCo with Emscripten have been added. This includes defining source files, checking their existencekey_mquat array sizes, ensuring correct memory allocation and setting specific properties and options for building WebAssembly (.wasm) and HTML outputpreventing potential integer overflow issues.
Target Library Links Updated
Some target link options have been adjusted, including removing the lodepng library from the target link list.
Also, for example in mjxmacro.h you have to involve adding explicit casting to size_t for the calculations of key_mpos and key_mquat array sizes, ensuring correct memory allocation and preventing potential integer overflow issues.
4. '''Prepare the Build Environment:'''