Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixes #2271, Add KD detection under CMake by Scott Percival
  • Loading branch information
gabomdq committed Nov 26, 2013
1 parent 96fe749 commit c343eab
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CMakeLists.txt
Expand Up @@ -651,6 +651,17 @@ if(UNIX AND NOT APPLE)
#endif
int main(int argc, char** argv) {}" HAVE_INPUT_EVENTS)

check_c_source_compiles("
#include <linux/kd.h>
#include <linux/keyboard.h>
int main(int argc, char **argv)
{
struct kbentry kbe;
kbe.kb_table = KG_CTRL;
ioctl(0, KDGKBENT, &kbe);
}" HAVE_INPUT_KD)

file(GLOB CORE_SOURCES ${SDL2_SOURCE_DIR}/src/core/linux/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${CORE_SOURCES})

Expand All @@ -665,6 +676,10 @@ if(UNIX AND NOT APPLE)
set(HAVE_SDL_HAPTIC TRUE)
endif(SDL_HAPTIC AND HAVE_INPUT_EVENTS)

if(HAVE_INPUT_KD)
set(SDL_INPUT_LINUXKD 1)
endif(HAVE_INPUT_KD)

check_include_file("libudev.h" HAVE_LIBUDEV_H)

# !!! FIXME: this needs pkg-config to find the include path, I think.
Expand Down
1 change: 1 addition & 0 deletions include/SDL_config.h.cmake
Expand Up @@ -215,6 +215,7 @@

/* Enable various input drivers */
#cmakedefine SDL_INPUT_LINUXEV @SDL_INPUT_LINUXEV@
#cmakedefine SDL_INPUT_LINUXKD @SDL_INPUT_LINUXKD@
#cmakedefine SDL_INPUT_TSLIB @SDL_INPUT_TSLIB@
#cmakedefine SDL_JOYSTICK_HAIKU @SDL_JOYSTICK_HAIKU@
#cmakedefine SDL_JOYSTICK_DINPUT @SDL_JOYSTICK_DINPUT@
Expand Down

0 comments on commit c343eab

Please sign in to comment.