Closed Moros1138 closed 2 years ago
The linking command cmake generates
usr/lib/emscripten/em++ -sALLOW_MEMORY_GROWTH=1 -sMAX_WEBGL_VERSION=2 -sMIN_WEBGL_VERSION=2 -sUSE_LIBPNG=1 -USE_SDL_MIXER=2 -sLLD_REPORT_UNDEFINED --preload-file [...]/pge-template-project/assets@assets @CMakeFiles/TestApp.dir/objects1.rsp -o bin/TestApp.html @CMakeFiles/TestApp.dir/linklibs.rsp
uses -USE_SDL_MIXER=2
to link with SDL_Mixer, but -sUSE_SDL_MIXER=2
is instead required and expected by em++
.
I'm disappointed in myself for missing that. Thanks for catching it. I've updated my cmake script and thanked you in there as well!
I spent some time integrating SWE with my CMake script. So far I've tested it on Linux, using SDL2_mixer as backend and it works as expected. However when built with emscripten, I get the following.
Compile Warnings
Linker Errors
For reproduction, you can get my sound engine branch from the git repo
Assuming you have an emscripten environment set up, you can clone the repo, then from inside the repo do the following:
At this point you should see the warnings and errors.
If you make it further trying to fix, you can do the following to launch the built app in your browser
Good luck!