Allow emscripten platform to build without threads

This commit is contained in:
Sam Lantinga
2022-08-01 09:51:21 -07:00
parent e4cc076a79
commit 954bbdf3ae
3 changed files with 19 additions and 19 deletions

View File

@@ -2711,10 +2711,14 @@ endif()
# We always need to have threads and timers around
if(NOT HAVE_SDL_THREADS)
message_error("Threads are needed by many SDL subsystems and may not be disabled")
#set(SDL_THREADS_DISABLED 1)
#file(GLOB THREADS_SOURCES ${SDL2_SOURCE_DIR}/src/thread/generic/*.c)
#list(APPEND SOURCE_FILES ${THREADS_SOURCES})
# The emscripten platform has been carefully vetted to work without threads
if (EMSCRIPTEN)
set(SDL_THREADS_DISABLED 1)
file(GLOB THREADS_SOURCES ${SDL2_SOURCE_DIR}/src/thread/generic/*.c)
list(APPEND SOURCE_FILES ${THREADS_SOURCES})
else()
message_error("Threads are needed by many SDL subsystems and may not be disabled")
endif()
endif()
if(NOT HAVE_SDL_TIMERS)
set(SDL_TIMER_DUMMY 1)