cmake: fold HAVE_INPUT_EVENTS into HAVE_LINUX_INPUT_H

(cherry picked from commit 8b1b6734f6)
This commit is contained in:
Anonymous Maarten 2023-11-02 20:46:14 +01:00
parent 15ead9a40d
commit 01eb305493
1 changed files with 4 additions and 5 deletions

View File

@ -1034,7 +1034,6 @@ if(SDL_LIBC)
string(REGEX REPLACE "[./]" "_" _HAVE_H ${_UPPER})
check_include_file("${_HEADER}" ${_HAVE_H})
endforeach()
check_include_file(linux/input.h HAVE_LINUX_INPUT_H)
set(STDC_HEADER_NAMES "stddef.h;stdarg.h;stdlib.h;string.h;stdio.h;wchar.h;float.h")
check_include_files("${STDC_HEADER_NAMES}" STDC_HEADERS)
@ -1479,7 +1478,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
#ifndef EVIOCGNAME
#error EVIOCGNAME() ioctl not available
#endif
int main(int argc, char** argv) { return 0; }" HAVE_INPUT_EVENTS)
int main(int argc, char** argv) { return 0; }" HAVE_LINUX_INPUT_H)
if(LINUX)
check_c_source_compiles("
@ -1515,11 +1514,11 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
}" HAVE_INPUT_WSCONS)
endif()
if(HAVE_INPUT_EVENTS)
if(HAVE_LINUX_INPUT_H)
set(SDL_INPUT_LINUXEV 1)
endif()
if(SDL_HAPTIC AND HAVE_INPUT_EVENTS)
if(SDL_HAPTIC AND HAVE_LINUX_INPUT_H)
set(SDL_HAPTIC_LINUX 1)
file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/linux/*.c)
list(APPEND SOURCE_FILES ${HAPTIC_SOURCES})
@ -1612,7 +1611,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/linux/SDL_udev.c")
endif()
if(HAVE_INPUT_EVENTS)
if(HAVE_LINUX_INPUT_H)
list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/linux/SDL_evdev.c")
list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/linux/SDL_evdev_kbd.c")
endif()