Threads are used by many SDL subsystems and may not be disabled.

Fixes https://github.com/libsdl-org/SDL/issues/5095
This commit is contained in:
Sam Lantinga 2022-08-01 09:15:44 -07:00
parent 15bcf58d77
commit e4cc076a79
2 changed files with 13 additions and 11 deletions

View File

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

View File

@ -522,14 +522,15 @@ if test x$enable_filesystem != xyes; then
else else
SUMMARY_modules="${SUMMARY_modules} filesystem" SUMMARY_modules="${SUMMARY_modules} filesystem"
fi fi
AC_ARG_ENABLE(threads, # Many subsystems depend on threads, so leave them enabled by default
[AS_HELP_STRING([--enable-threads], [Enable the threading subsystem [default=yes]])], #AC_ARG_ENABLE(threads,
, enable_threads=yes) #[AS_HELP_STRING([--enable-threads], [Enable the threading subsystem [default=yes]])],
if test x$enable_threads != xyes; then # , enable_threads=yes)
AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ]) #if test x$enable_threads != xyes; then
else # AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ])
SUMMARY_modules="${SUMMARY_modules} threads" #else
fi # SUMMARY_modules="${SUMMARY_modules} threads"
#fi
AC_ARG_ENABLE(timers, AC_ARG_ENABLE(timers,
[AS_HELP_STRING([--enable-timers], [Enable the timer subsystem [default=yes]])], [AS_HELP_STRING([--enable-timers], [Enable the timer subsystem [default=yes]])],
, enable_timers=yes) , enable_timers=yes)