cmake: add sensor subsystem to the build.

This commit is contained in:
Ryan C. Gordon 2018-08-23 14:32:30 -04:00
parent 8adadf8f0e
commit df5d565f48

View File

@ -267,7 +267,7 @@ endif()
set(SDL_SUBSYSTEMS
Atomic Audio Video Render Events Joystick Haptic Power Threads Timers
File Loadso CPUinfo Filesystem Dlopen)
File Loadso CPUinfo Filesystem Dlopen Sensor)
foreach(_SUB ${SDL_SUBSYSTEMS})
string(TOUPPER ${_SUB} _OPT)
if (NOT DEFINED SDL_${_OPT}_ENABLED_BY_DEFAULT)
@ -855,6 +855,12 @@ if(ANDROID)
set(SOURCE_FILES ${SOURCE_FILES} ${TIMER_SOURCES})
set(HAVE_SDL_TIMERS TRUE)
endif()
if(SDL_SENSOR)
set(SDL_SENSOR_ANDROID 1)
set(HAVE_SDL_SENSORS TRUE)
file(GLOB ANDROID_SENSOR_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/android/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_SENSOR_SOURCES})
endif()
if(SDL_VIDEO)
set(SDL_VIDEO_DRIVER_ANDROID 1)
file(GLOB ANDROID_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/android/*.c)
@ -1571,6 +1577,11 @@ if(NOT HAVE_SDL_FILESYSTEM)
file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/dummy/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
endif()
if(NOT HAVE_SDL_SENSORS)
set(SDL_SENSORS_DISABLED 1)
file(GLOB SENSORS_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/dummy/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${SENSORS_SOURCES})
endif()
# We always need to have threads and timers around
if(NOT HAVE_SDL_THREADS)