build(linux): fail build if capture dependencies not found (#3305)

This commit is contained in:
ReenigneArcher 2024-10-14 18:28:55 -04:00 committed by GitHub
commit 7352e7277a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 16 deletions

View file

@ -67,6 +67,8 @@ if(${SUNSHINE_ENABLE_CUDA})
# message(STATUS "CUDA NVCC Flags: ${CUDA_NVCC_FLAGS}")
message(STATUS "CUDA Architectures: ${CMAKE_CUDA_ARCHITECTURES}")
elseif(${CUDA_FAIL_ON_MISSING})
message(FATAL_ERROR "CUDA not found")
endif()
endif()
if(CUDA_FOUND)
@ -82,8 +84,8 @@ endif()
# drm
if(${SUNSHINE_ENABLE_DRM})
find_package(LIBDRM)
find_package(LIBCAP)
find_package(LIBDRM REQUIRED)
find_package(LIBCAP REQUIRED)
else()
set(LIBDRM_FOUND OFF)
set(LIBCAP_FOUND OFF)
@ -95,10 +97,6 @@ if(LIBDRM_FOUND AND LIBCAP_FOUND)
list(APPEND PLATFORM_TARGET_FILES
"${CMAKE_SOURCE_DIR}/src/platform/linux/kmsgrab.cpp")
list(APPEND SUNSHINE_DEFINITIONS EGL_NO_X11=1)
elseif(NOT LIBDRM_FOUND)
message(WARNING "Missing libdrm")
elseif(NOT LIBDRM_FOUND)
message(WARNING "Missing libcap")
endif()
# evdev
@ -106,7 +104,7 @@ include(dependencies/libevdev_Sunshine)
# vaapi
if(${SUNSHINE_ENABLE_VAAPI})
find_package(Libva)
find_package(Libva REQUIRED)
else()
set(LIBVA_FOUND OFF)
endif()
@ -121,7 +119,7 @@ endif()
# wayland
if(${SUNSHINE_ENABLE_WAYLAND})
find_package(Wayland)
find_package(Wayland REQUIRED)
else()
set(WAYLAND_FOUND OFF)
endif()
@ -153,7 +151,7 @@ endif()
# x11
if(${SUNSHINE_ENABLE_X11})
find_package(X11)
find_package(X11 REQUIRED)
else()
set(X11_FOUND OFF)
endif()
@ -187,10 +185,9 @@ if(${SUNSHINE_ENABLE_TRAY})
endif()
pkg_check_modules(LIBNOTIFY libnotify)
if(NOT APPINDICATOR_FOUND OR NOT LIBNOTIFY_FOUND)
set(SUNSHINE_TRAY 0)
message(WARNING "Missing appindicator or libnotify, disabling tray icon")
message(STATUS "APPINDICATOR_FOUND: ${APPINDICATOR_FOUND}")
message(STATUS "LIBNOTIFY_FOUND: ${LIBNOTIFY_FOUND}")
message(FATAL_ERROR "Couldn't find either appindicator or libnotify")
else()
include_directories(SYSTEM ${APPINDICATOR_INCLUDE_DIRS} ${LIBNOTIFY_INCLUDE_DIRS})
link_directories(${APPINDICATOR_LIBRARY_DIRS} ${LIBNOTIFY_LIBRARY_DIRS})
@ -203,10 +200,6 @@ else()
message(STATUS "Tray icon disabled")
endif()
if(${SUNSHINE_ENABLE_TRAY} AND ${SUNSHINE_TRAY} EQUAL 0 AND SUNSHINE_REQUIRE_TRAY)
message(FATAL_ERROR "Tray icon is required")
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()