###### Subsystems (core) ######
config_query_option SDL3_OPTS "Enable the GPU subsystem?" y \
             "-DSDL_GPU=ON" "-DSDL_GPU=OFF" &&

config_query_option SDL3_OPTS "Enable the Render subsystem?" y \
             "-DSDL_RENDER=ON" "-DSDL_RENDER=OFF" &&

config_query_option SDL3_OPTS "Enable the Camera subsystem?" y \
             "-DSDL_CAMERA=ON" "-DSDL_CAMERA=OFF" &&

config_query_option SDL3_OPTS "Enable the Joystick subsystem?" y \
             "-DSDL_JOYSTICK=ON" "-DSDL_JOYSTICK=OFF" &&

config_query_option SDL3_OPTS "Enable the Haptic (force feedback) subsystem?" y \
             "-DSDL_HAPTIC=ON" "-DSDL_HAPTIC=OFF" &&

config_query_option SDL3_OPTS "Enable the HIDAPI subsystem?" y \
             "-DSDL_HIDAPI=ON" "-DSDL_HIDAPI=OFF" &&

config_query_option SDL3_OPTS "Enable the power management subsystem?" y \
             "-DSDL_POWER=ON" "-DSDL_POWER=OFF" &&

config_query_option SDL3_OPTS "Enable the Sensor subsystem?" y \
             "-DSDL_SENSOR=ON" "-DSDL_SENSOR=OFF" &&

config_query_option SDL3_OPTS "Enable the Dialog subsystem?" y \
             "-DSDL_DIALOG=ON" "-DSDL_DIALOG=OFF" &&

config_query_option SDL3_OPTS "Enable the System Tray subsystem?" y \
             "-DSDL_TRAY=ON" "-DSDL_TRAY=OFF" &&

###### Internal HIDAPI drivers (only if SDL_HIDAPI is enabled) ######
if list_find "$SDL3_OPTS" "-DSDL_HIDAPI=ON" ; then
    config_query_option SDL3_OPTS "Enable HIDAPI for joysticks?" y \
                 "-DSDL_HIDAPI_JOYSTICK=ON" "-DSDL_HIDAPI_JOYSTICK=OFF" &&
    config_query_option SDL3_OPTS "Enable virtual joystick support?" y \
                 "-DSDL_VIRTUAL_JOYSTICK=ON" "-DSDL_VIRTUAL_JOYSTICK=OFF"
fi &&

###### Render backends (only if SDL_RENDER is enabled) ######
if list_find "$SDL3_OPTS" "-DSDL_RENDER=ON" ; then
    config_query_option SDL3_OPTS "Enable GPU render driver?" n \
                 "-DSDL_RENDER_GPU=ON" "-DSDL_RENDER_GPU=OFF"
fi &&

###### Other common options ######
config_query_option SDL3_OPTS "Use clock_gettime() instead of gettimeofday()?" y \
             "-DSDL_CLOCK_GETTIME=ON" "-DSDL_CLOCK_GETTIME=OFF" &&

config_query_option SDL3_OPTS "Use an rpath when linking SDL?" y \
             "-DSDL_RPATH=ON" "-DSDL_RPATH=OFF" &&

config_query_option SDL3_OPTS "Use gcc builtin atomics?" y \
             "-DSDL_GCC_ATOMICS=ON" "-DSDL_GCC_ATOMICS=OFF"
