diff --git a/CMakeLists.txt b/CMakeLists.txt
index eff1116..ff325dd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,7 +9,7 @@ set(MOONLIGHT_PATCH_VERSION 0)
set(MOONLIGHT_VERSION ${MOONLIGHT_MAJOR_VERSION}.${MOONLIGHT_MINOR_VERSION}.${MOONLIGHT_PATCH_VERSION})
aux_source_directory(./src SRC_LIST)
-aux_source_directory(./src/input SRC_LIST)
+list(APPEND SRC_LIST ./src/input/evdev.c ./src/input/mapping.c ./src/input/udev.c)
set(MOONLIGHT_DEFINITIONS)
@@ -25,7 +25,7 @@ pkg_check_modules(UDEV REQUIRED libudev)
pkg_check_modules(SDL sdl2>=2.0.4)
pkg_check_modules(AVCODEC libavcodec)
pkg_check_modules(AVUTIL libavutil)
-pkg_check_modules(XLIB x11-xcb)
+pkg_check_modules(XLIB x11)
pkg_check_modules(LIBVA vdpau)
pkg_check_modules(PULSE libpulse-simple)
pkg_check_modules(CEC libcec>=3.0.0)
@@ -61,7 +61,7 @@ endif()
if (SOFTWARE_FOUND)
list(APPEND SRC_LIST ./src/video/ffmpeg.c)
if (SDL_FOUND)
- list(APPEND SRC_LIST ./src/video/sdl.c ./src/audio/sdl.c)
+ list(APPEND SRC_LIST ./src/video/sdl.c ./src/audio/sdl.c ./src/input/sdl.c)
list(APPEND MOONLIGHT_DEFINITIONS HAVE_SDL)
list(APPEND MOONLIGHT_OPTIONS SDL)
endif()
@@ -94,6 +94,10 @@ if (PULSE_FOUND)
list(APPEND MOONLIGHT_OPTIONS PULSE)
endif()
+if (CEC_FOUND)
+ list(APPEND SRC_LIST ./src/input/cec.c)
+endif()
+
include_directories("${PROJECT_BINARY_DIR}")
add_subdirectory(libgamestream)
diff --git a/src/input/cec.c b/src/input/cec.c
index 58ec12b..342ef27 100644
--- a/src/input/cec.c
+++ b/src/input/cec.c
@@ -17,8 +17,6 @@
* along with Moonlight; if not, see .
*/
-#ifdef HAVE_LIBCEC
-
#include
#include
@@ -111,4 +109,3 @@ void cec_init() {
g_iface.set_active_source(g_iface.connection, g_config.deviceTypes.types[0]);
}
-#endif /* HAVE_LIBCEC */
diff --git a/src/input/sdlinput.c b/src/input/sdl.c
similarity index 99%
rename from src/input/sdlinput.c
rename to src/input/sdl.c
index 26fab78..950af43 100644
--- a/src/input/sdlinput.c
+++ b/src/input/sdl.c
@@ -17,9 +17,7 @@
* along with Moonlight; if not, see .
*/
-#ifdef HAVE_SDL
-
-#include "sdlinput.h"
+#include "sdl.h"
#include "../sdl.h"
#include
@@ -239,5 +237,3 @@ int sdlinput_handle_event(SDL_Event* event) {
}
return SDL_NOTHING;
}
-
-#endif /* HAVE_SDL */
diff --git a/src/input/sdlinput.h b/src/input/sdl.h
similarity index 98%
rename from src/input/sdlinput.h
rename to src/input/sdl.h
index 8b2b23b..9157680 100644
--- a/src/input/sdlinput.h
+++ b/src/input/sdl.h
@@ -17,8 +17,6 @@
* along with Moonlight; if not, see .
*/
-#ifdef HAVE_SDL
-
#include
#include
@@ -101,5 +99,3 @@ static const short keyCodes5[] = {
void sdlinput_init(char* mappings);
int sdlinput_handle_event(SDL_Event* event);
-
-#endif /* HAVE_SDL */
diff --git a/src/main.c b/src/main.c
index 5a47485..55a3578 100644
--- a/src/main.c
+++ b/src/main.c
@@ -31,8 +31,12 @@
#include "input/mapping.h"
#include "input/evdev.h"
#include "input/udev.h"
+#ifdef HAVE_CEC
#include "input/cec.h"
-#include "input/sdlinput.h"
+#endif
+#ifdef HAVE_SDL
+#include "input/sdl.h"
+#endif
#include
diff --git a/src/sdl.c b/src/sdl.c
index 0b1342c..a49d02e 100644
--- a/src/sdl.c
+++ b/src/sdl.c
@@ -20,7 +20,7 @@
#ifdef HAVE_SDL
#include "sdl.h"
-#include "input/sdlinput.h"
+#include "input/sdl.h"
#include