cmake: fold HAVE_INPUT_EVENTS into HAVE_LINUX_INPUT_H

This commit is contained in:
Anonymous Maarten 2023-11-02 20:46:14 +01:00 committed by Anonymous Maarten
parent 97c2bdf256
commit 8b1b6734f6

View file

@ -1065,7 +1065,6 @@ if(SDL_LIBC)
string(REGEX REPLACE "[./]" "_" _HAVE_H ${_UPPER}) string(REGEX REPLACE "[./]" "_" _HAVE_H ${_UPPER})
check_include_file("${_HEADER}" ${_HAVE_H}) check_include_file("${_HEADER}" ${_HAVE_H})
endforeach() 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") 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) check_include_files("${STDC_HEADER_NAMES}" STDC_HEADERS)
@ -1507,7 +1506,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
#ifndef EVIOCGNAME #ifndef EVIOCGNAME
#error EVIOCGNAME() ioctl not available #error EVIOCGNAME() ioctl not available
#endif #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) if(LINUX)
check_c_source_compiles(" check_c_source_compiles("
@ -1543,11 +1542,11 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
}" HAVE_INPUT_WSCONS) }" HAVE_INPUT_WSCONS)
endif() endif()
if(HAVE_INPUT_EVENTS) if(HAVE_LINUX_INPUT_H)
set(SDL_INPUT_LINUXEV 1) set(SDL_INPUT_LINUXEV 1)
endif() endif()
if(SDL_HAPTIC AND HAVE_INPUT_EVENTS) if(SDL_HAPTIC AND HAVE_LINUX_INPUT_H)
set(SDL_HAPTIC_LINUX 1) set(SDL_HAPTIC_LINUX 1)
file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/linux/*.c) file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/linux/*.c)
list(APPEND SOURCE_FILES ${HAPTIC_SOURCES}) list(APPEND SOURCE_FILES ${HAPTIC_SOURCES})
@ -1633,7 +1632,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") list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/linux/SDL_udev.c")
endif() 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.c")
list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/linux/SDL_evdev_kbd.c") list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/linux/SDL_evdev_kbd.c")
endif() endif()