cmake: add support for some BSD's wscons input

This commit is contained in:
Anonymous Maarten 2022-11-25 02:39:50 +01:00 committed by Anonymous Maarten
parent ab8df9096c
commit 1bbff6596c
2 changed files with 17 additions and 0 deletions

View File

@ -1458,6 +1458,18 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
ioctl(0, KDENABIO, 1);
return 0;
}" HAVE_INPUT_KBIO)
elseif(OPENBSD OR NETBSD)
check_c_source_compiles("
#include <sys/time.h>
#include <dev/wscons/wsconsio.h>
#include <dev/wscons/wsksymdef.h>
#include <dev/wscons/wsksymvar.h>
#include <sys/ioctl.h>
int main(int argc, char **argv) {
struct wskbd_map_data data;
ioctl(0, WSKBDIO_GETMAP, &data);
return 0;
}" HAVE_INPUT_WSCONS)
endif()
if(HAVE_INPUT_EVENTS)
@ -1479,6 +1491,10 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
set(SDL_INPUT_FBSDKBIO 1)
endif()
if(HAVE_INPUT_WSCONS)
set(SDL_INPUT_WSCONS 1)
endif()
check_include_file("libudev.h" HAVE_LIBUDEV_H)
check_include_file("sys/inotify.h" HAVE_SYS_INOTIFY_H)
check_symbol_exists(inotify_init "sys/inotify.h" HAVE_INOTIFY_INIT)

View File

@ -318,6 +318,7 @@
#cmakedefine SDL_INPUT_LINUXEV @SDL_INPUT_LINUXEV@
#cmakedefine SDL_INPUT_LINUXKD @SDL_INPUT_LINUXKD@
#cmakedefine SDL_INPUT_FBSDKBIO @SDL_INPUT_FBSDKBIO@
#cmakedefine SDL_INPUT_WSCONS @SDL_INPUT_WSCONS@
#cmakedefine SDL_JOYSTICK_ANDROID @SDL_JOYSTICK_ANDROID@
#cmakedefine SDL_JOYSTICK_HAIKU @SDL_JOYSTICK_HAIKU@
#cmakedefine SDL_JOYSTICK_WGI @SDL_JOYSTICK_WGI@