From 1bbff6596ca6a1ed8f2c86ac45f198d253d7d9c8 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Fri, 25 Nov 2022 02:39:50 +0100 Subject: [PATCH] cmake: add support for some BSD's wscons input --- CMakeLists.txt | 16 ++++++++++++++++ include/SDL_config.h.cmake | 1 + 2 files changed, 17 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 11e1e92b7..d772ce84d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 + #include + #include + #include + #include + 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) diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake index eeb72dda8..e16bb96ca 100644 --- a/include/SDL_config.h.cmake +++ b/include/SDL_config.h.cmake @@ -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@