To compile to web build I use the Raylib library with Emscripten. Take a look at my GitHub for examples of how to do the CMake files for web builds (link).
Thanks man ill take a look