Skip to content

Commit

Permalink
build(cmake) properly find evdev (#2176)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher authored Feb 26, 2024
1 parent c6f94e9 commit 8a7a6c4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
13 changes: 11 additions & 2 deletions cmake/compile_definitions/linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,17 @@ elseif(NOT LIBDRM_FOUND)
message(WARNING "Missing libcap")
endif()

# evdev
pkg_check_modules(PC_EVDEV libevdev REQUIRED)
find_path(EVDEV_INCLUDE_DIR libevdev/libevdev.h
HINTS ${PC_EVDEV_INCLUDE_DIRS} ${PC_EVDEV_INCLUDEDIR})
find_library(EVDEV_LIBRARY
NAMES evdev libevdev)
if(EVDEV_INCLUDE_DIR AND EVDEV_LIBRARY)
include_directories(SYSTEM ${EVDEV_INCLUDE_DIR})
list(APPEND PLATFORM_LIBRARIES ${EVDEV_LIBRARY})
endif()

# vaapi
if(${SUNSHINE_ENABLE_VAAPI})
find_package(Libva)
Expand Down Expand Up @@ -241,13 +252,11 @@ list(APPEND PLATFORM_TARGET_FILES
list(APPEND PLATFORM_LIBRARIES
Boost::dynamic_linking
dl
evdev
numa
pulse
pulse-simple)

include_directories(
SYSTEM
/usr/include/libevdev-1.0
"${CMAKE_SOURCE_DIR}/third-party/nv-codec-headers/include"
"${CMAKE_SOURCE_DIR}/third-party/glad/include")
1 change: 0 additions & 1 deletion packaging/linux/flatpak/dev.lizardbyte.sunshine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@ modules:
append-path: /usr/lib/sdk/node18/bin
build-args:
- --share=network
cxxflags: -I${C_INCLUDE_PATH}/libevdev-1.0
env:
npm_config_nodedir: /usr/lib/sdk/node18
NPM_CONFIG_LOGLEVEL: info
Expand Down
2 changes: 2 additions & 0 deletions src/platform/linux/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
#include <linux/uinput.h>
#include <poll.h>

extern "C" {
#include <libevdev/libevdev-uinput.h>
#include <libevdev/libevdev.h>
}

#ifdef SUNSHINE_BUILD_X11
#include <X11/Xutil.h>
Expand Down

0 comments on commit 8a7a6c4

Please sign in to comment.