Skip to content

Commit

Permalink
brew linux updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Jun 15, 2024
1 parent 70a94cd commit 7cf2d1c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 24 deletions.
14 changes: 9 additions & 5 deletions cmake/compile_definitions/linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -225,17 +225,21 @@ endif()
if(${SUNSHINE_USE_LEGACY_INPUT}) # TODO: Remove this legacy option after the next stable release
list(APPEND PLATFORM_TARGET_FILES "${CMAKE_SOURCE_DIR}/src/platform/linux/input/legacy_input.cpp")
else()
if(EVDEV_INCLUDE_DIR AND EVDEV_LIBRARY)
# These two needs to be set before adding the inputtino subdirectory in order for them to be picked up
set(LIBEVDEV_CUSTOM_INCLUDE_DIR ${EVDEV_INCLUDE_DIR})
set(LIBEVDEV_CUSTOM_LIBRARY ${EVDEV_LIBRARY})
endif ()
# These need to be set before adding the inputtino subdirectory in order for them to be picked up
set(LIBEVDEV_CUSTOM_INCLUDE_DIR "${EVDEV_INCLUDE_DIR}")
set(LIBEVDEV_CUSTOM_LIBRARY "${EVDEV_LIBRARY}")

add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/inputtino")
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES inputtino::libinputtino)
file(GLOB_RECURSE INPUTTINO_SOURCES
${CMAKE_SOURCE_DIR}/src/platform/linux/input/inputtino*.h
${CMAKE_SOURCE_DIR}/src/platform/linux/input/inputtino*.cpp)
list(APPEND PLATFORM_TARGET_FILES ${INPUTTINO_SOURCES})

# build libevdev before the libinputtino target
if(EXTERNAL_PROJECT_LIBEVDEV_USED)
add_dependencies(libinputtino libevdev)
endif()
endif()

list(APPEND PLATFORM_TARGET_FILES
Expand Down
3 changes: 3 additions & 0 deletions cmake/dependencies/libevdev_Sunshine.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ else()
endif()

if(EVDEV_INCLUDE_DIR AND EVDEV_LIBRARY)
message(STATUS "Found libevdev library: ${EVDEV_LIBRARY}")
message(STATUS "Found libevdev include directory: ${EVDEV_INCLUDE_DIR}")

include_directories(SYSTEM ${EVDEV_INCLUDE_DIR})
list(APPEND PLATFORM_LIBRARIES ${EVDEV_LIBRARY})
else()
Expand Down
14 changes: 0 additions & 14 deletions cmake/macros/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,3 @@ macro(find_package) # cmake-lint: disable=C0103
_find_package(${ARGV})
endif()
endmacro()

# override pkg_check_modules function
macro(pkg_check_modules) # cmake-lint: disable=C0103
string(TOLOWER "${ARGV0}" ARGV0_LOWER)
if(
(("${ARGV0_LOWER}" STREQUAL "boost") AND DEFINED FETCH_CONTENT_BOOST_USED) OR
(("${ARGV0_LOWER}" STREQUAL "libevdev") AND DEFINED EXTERNAL_PROJECT_LIBEVDEV_USED)
)
# Do nothing, as the package has already been fetched
else()
# Call the original pkg_check_modules function
_pkg_check_modules(${ARGV})
endif()
endmacro()
4 changes: 0 additions & 4 deletions packaging/sunshine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ def install
-DSUNSHINE_ENABLE_TRAY=OFF
-DTESTS_ENABLE_PYTHON_TESTS=OFF
]
# On Linux we have to first build the evdev target manually since the library is not available on homebrew
on_linux do
system "cmake", "-S", ".", "-B", "build", *std_cmake_args, "--target", "libevdev"
end
system "cmake", "-S", ".", "-B", "build", *std_cmake_args, *args

cd "build" do
Expand Down
2 changes: 1 addition & 1 deletion third-party/inputtino
Submodule inputtino updated 1 files
+2 −2 CMakeLists.txt

0 comments on commit 7cf2d1c

Please sign in to comment.