SDL icon indicating copy to clipboard operation
SDL copied to clipboard

[Docs] README-emscripten.md may contain an error

Open coder210 opened this issue 6 months ago • 0 comments

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.

screenshot

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()

coder210 avatar Jun 08 '25 05:06 coder210