Input methods seperatly added in CMakeLists

This commit is contained in:
Iwan Timmer 2017-05-27 21:43:20 +02:00
parent 3134046bae
commit 85cc4da449
6 changed files with 14 additions and 17 deletions

View File

@ -9,7 +9,7 @@ set(MOONLIGHT_PATCH_VERSION 0)
set(MOONLIGHT_VERSION ${MOONLIGHT_MAJOR_VERSION}.${MOONLIGHT_MINOR_VERSION}.${MOONLIGHT_PATCH_VERSION}) set(MOONLIGHT_VERSION ${MOONLIGHT_MAJOR_VERSION}.${MOONLIGHT_MINOR_VERSION}.${MOONLIGHT_PATCH_VERSION})
aux_source_directory(./src SRC_LIST) 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) set(MOONLIGHT_DEFINITIONS)
@ -25,7 +25,7 @@ pkg_check_modules(UDEV REQUIRED libudev)
pkg_check_modules(SDL sdl2>=2.0.4) pkg_check_modules(SDL sdl2>=2.0.4)
pkg_check_modules(AVCODEC libavcodec) pkg_check_modules(AVCODEC libavcodec)
pkg_check_modules(AVUTIL libavutil) pkg_check_modules(AVUTIL libavutil)
pkg_check_modules(XLIB x11-xcb) pkg_check_modules(XLIB x11)
pkg_check_modules(LIBVA vdpau) pkg_check_modules(LIBVA vdpau)
pkg_check_modules(PULSE libpulse-simple) pkg_check_modules(PULSE libpulse-simple)
pkg_check_modules(CEC libcec>=3.0.0) pkg_check_modules(CEC libcec>=3.0.0)
@ -61,7 +61,7 @@ endif()
if (SOFTWARE_FOUND) if (SOFTWARE_FOUND)
list(APPEND SRC_LIST ./src/video/ffmpeg.c) list(APPEND SRC_LIST ./src/video/ffmpeg.c)
if (SDL_FOUND) 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_DEFINITIONS HAVE_SDL)
list(APPEND MOONLIGHT_OPTIONS SDL) list(APPEND MOONLIGHT_OPTIONS SDL)
endif() endif()
@ -94,6 +94,10 @@ if (PULSE_FOUND)
list(APPEND MOONLIGHT_OPTIONS PULSE) list(APPEND MOONLIGHT_OPTIONS PULSE)
endif() endif()
if (CEC_FOUND)
list(APPEND SRC_LIST ./src/input/cec.c)
endif()
include_directories("${PROJECT_BINARY_DIR}") include_directories("${PROJECT_BINARY_DIR}")
add_subdirectory(libgamestream) add_subdirectory(libgamestream)

View File

@ -17,8 +17,6 @@
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>. * along with Moonlight; if not, see <http://www.gnu.org/licenses/>.
*/ */
#ifdef HAVE_LIBCEC
#include <Limelight.h> #include <Limelight.h>
#include <ceccloader.h> #include <ceccloader.h>
@ -111,4 +109,3 @@ void cec_init() {
g_iface.set_active_source(g_iface.connection, g_config.deviceTypes.types[0]); g_iface.set_active_source(g_iface.connection, g_config.deviceTypes.types[0]);
} }
#endif /* HAVE_LIBCEC */

View File

@ -17,9 +17,7 @@
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>. * along with Moonlight; if not, see <http://www.gnu.org/licenses/>.
*/ */
#ifdef HAVE_SDL #include "sdl.h"
#include "sdlinput.h"
#include "../sdl.h" #include "../sdl.h"
#include <Limelight.h> #include <Limelight.h>
@ -239,5 +237,3 @@ int sdlinput_handle_event(SDL_Event* event) {
} }
return SDL_NOTHING; return SDL_NOTHING;
} }
#endif /* HAVE_SDL */

View File

@ -17,8 +17,6 @@
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>. * along with Moonlight; if not, see <http://www.gnu.org/licenses/>.
*/ */
#ifdef HAVE_SDL
#include <stdbool.h> #include <stdbool.h>
#include <SDL.h> #include <SDL.h>
@ -101,5 +99,3 @@ static const short keyCodes5[] = {
void sdlinput_init(char* mappings); void sdlinput_init(char* mappings);
int sdlinput_handle_event(SDL_Event* event); int sdlinput_handle_event(SDL_Event* event);
#endif /* HAVE_SDL */

View File

@ -31,8 +31,12 @@
#include "input/mapping.h" #include "input/mapping.h"
#include "input/evdev.h" #include "input/evdev.h"
#include "input/udev.h" #include "input/udev.h"
#ifdef HAVE_CEC
#include "input/cec.h" #include "input/cec.h"
#include "input/sdlinput.h" #endif
#ifdef HAVE_SDL
#include "input/sdl.h"
#endif
#include <Limelight.h> #include <Limelight.h>

View File

@ -20,7 +20,7 @@
#ifdef HAVE_SDL #ifdef HAVE_SDL
#include "sdl.h" #include "sdl.h"
#include "input/sdlinput.h" #include "input/sdl.h"
#include <Limelight.h> #include <Limelight.h>