cmake: add sensor subsystem to the build.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 23 Aug 2018 14:32:30 -0400
changeset 12149e037e9c2bc00
parent 12148 bb47da8eb0d7
child 12150 f958f3c2e006
cmake: add sensor subsystem to the build.
CMakeLists.txt
     1.1 --- a/CMakeLists.txt	Thu Aug 23 10:51:54 2018 -0700
     1.2 +++ b/CMakeLists.txt	Thu Aug 23 14:32:30 2018 -0400
     1.3 @@ -267,7 +267,7 @@
     1.4  
     1.5  set(SDL_SUBSYSTEMS
     1.6      Atomic Audio Video Render Events Joystick Haptic Power Threads Timers
     1.7 -    File Loadso CPUinfo Filesystem Dlopen)
     1.8 +    File Loadso CPUinfo Filesystem Dlopen Sensor)
     1.9  foreach(_SUB ${SDL_SUBSYSTEMS})
    1.10    string(TOUPPER ${_SUB} _OPT)
    1.11    if (NOT DEFINED SDL_${_OPT}_ENABLED_BY_DEFAULT)
    1.12 @@ -855,6 +855,12 @@
    1.13      set(SOURCE_FILES ${SOURCE_FILES} ${TIMER_SOURCES})
    1.14      set(HAVE_SDL_TIMERS TRUE)
    1.15    endif()
    1.16 +  if(SDL_SENSOR)
    1.17 +    set(SDL_SENSOR_ANDROID 1)
    1.18 +    set(HAVE_SDL_SENSORS TRUE)
    1.19 +    file(GLOB ANDROID_SENSOR_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/android/*.c)
    1.20 +    set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_SENSOR_SOURCES})
    1.21 +  endif()
    1.22    if(SDL_VIDEO)
    1.23      set(SDL_VIDEO_DRIVER_ANDROID 1)
    1.24      file(GLOB ANDROID_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/android/*.c)
    1.25 @@ -1571,6 +1577,11 @@
    1.26    file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/dummy/*.c)
    1.27    set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
    1.28  endif()
    1.29 +if(NOT HAVE_SDL_SENSORS)
    1.30 +  set(SDL_SENSORS_DISABLED 1)
    1.31 +  file(GLOB SENSORS_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/dummy/*.c)
    1.32 +  set(SOURCE_FILES ${SOURCE_FILES} ${SENSORS_SOURCES})
    1.33 +endif()
    1.34  
    1.35  # We always need to have threads and timers around
    1.36  if(NOT HAVE_SDL_THREADS)