build: fix / update sensors (windows) configuration

- SDL_config.h.in: add missing defines SDL_SENSOR_COREMOTION
  and SDL_SENSOR_WINDOWS (configure did set SDL_SENSOR_WINDOWS
  but it never went in SDL_config.h or Makefile.)
- SDL_config.h.cmake: remove duplicated SDL_SENSOR_XXX cmake
  defines.
- autofoo, cmake: check for sensorsapi.h header before enabling
  windows sensors.
This commit is contained in:
Ozkan Sezer
2020-10-12 01:02:28 +03:00
parent 10eb5108b6
commit 196cda69f2
6 changed files with 29 additions and 9 deletions

View File

@@ -1431,6 +1431,7 @@ elseif(WINDOWS)
# headers needed elsewhere
check_include_file(mmdeviceapi.h HAVE_MMDEVICEAPI_H)
check_include_file(audioclient.h HAVE_AUDIOCLIENT_H)
check_include_file(sensorsapi.h HAVE_SENSORSAPI_H)
if(SDL_AUDIO)
set(SDL_AUDIO_DRIVER_WINMM 1)
@@ -1482,7 +1483,7 @@ elseif(WINDOWS)
set(HAVE_SDL_THREADS TRUE)
endif()
if(SDL_SENSOR)
if(SDL_SENSOR AND HAVE_SENSORSAPI_H)
set(SDL_SENSOR_WINDOWS 1)
set(HAVE_SDL_SENSORS TRUE)
file(GLOB WINDOWS_SENSOR_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/windows/*.c)