SDL
SDL copied to clipboard
[Docs] README-emscripten.md may contain an error
The README-emscripten.md may contain an error about enabling SDL3 multithreading in Emscripten.
mkdir build cd build emcmake cmake -DSDL_THREADS=ON .. you can also do emcmake cmake -G Ninja .. and then use ninja instead of this command. emmake make -j4
emcmake cmake -DSDL_THREADS=ON .. This line of command cannot enable multithreading in Emscripten for SDL3 versions 3.2.16 and 3.2.6. And there is a warning about the SDL_THREADS macro being unused during SDL compilation.

my solution:
In CMakeList.txt
if (UNIX_OR_MAC_SYS AND NOT EMSCRIPTEN) set(SDL_PTHREADS_DEFAULT ON) else() set(SDL_PTHREADS_DEFAULT OFF) endif()
replace
if (UNIX_OR_MAC_SYS AND NOT EMSCRIPTEN) set(SDL_PTHREADS_DEFAULT ON) else() set(SDL_PTHREADS_DEFAULT ON) endif()