Added warning if only one of libcap or libdrm has been found
This commit is contained in:
@@ -137,7 +137,12 @@ else()
|
|||||||
list(APPEND PLATFORM_LIBRARIES ${LIBDRM_LIBRARIES} ${LIBCAP_LIBRARIES})
|
list(APPEND PLATFORM_LIBRARIES ${LIBDRM_LIBRARIES} ${LIBCAP_LIBRARIES})
|
||||||
list(APPEND PLATFORM_TARGET_FILES sunshine/platform/linux/kmsgrab.cpp)
|
list(APPEND PLATFORM_TARGET_FILES sunshine/platform/linux/kmsgrab.cpp)
|
||||||
list(APPEND SUNSHINE_DEFINITIONS EGL_NO_X11=1)
|
list(APPEND SUNSHINE_DEFINITIONS EGL_NO_X11=1)
|
||||||
|
elseif(LIBDRM_FOUND)
|
||||||
|
message(WARNING "Found libdrm, yet there is no libcap")
|
||||||
|
elseif(LIBDRM_FOUND)
|
||||||
|
message(WARNING "Found libcap, yet there is no libdrm")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WAYLAND_FOUND)
|
if(WAYLAND_FOUND)
|
||||||
add_compile_definitions(SUNSHINE_BUILD_WAYLAND)
|
add_compile_definitions(SUNSHINE_BUILD_WAYLAND)
|
||||||
macro(genWayland FILENAME)
|
macro(genWayland FILENAME)
|
||||||
@@ -175,8 +180,8 @@ else()
|
|||||||
sunshine/platform/linux/wlgrab.cpp
|
sunshine/platform/linux/wlgrab.cpp
|
||||||
sunshine/platform/linux/wayland.cpp)
|
sunshine/platform/linux/wayland.cpp)
|
||||||
endif()
|
endif()
|
||||||
if(NOT ${X11_FOUND} AND NOT ${LIBDRM_FOUND} AND NOT ${WAYLAND_FOUND})
|
if(NOT ${X11_FOUND} AND NOT (${LIBDRM_FOUND} AND ${LIBCAP_FOUND}) AND NOT ${WAYLAND_FOUND})
|
||||||
message(FATAL_ERROR "Couldn't find either x11, wayland or libdrm")
|
message(FATAL_ERROR "Couldn't find either x11, wayland or (libdrm and libcap)")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND PLATFORM_TARGET_FILES
|
list(APPEND PLATFORM_TARGET_FILES
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#include <drm_fourcc.h>
|
#include <drm_fourcc.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <sys/capability.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <xf86drm.h>
|
#include <xf86drm.h>
|
||||||
#include <xf86drmMode.h>
|
#include <xf86drmMode.h>
|
||||||
#include <sys/capability.h>
|
|
||||||
|
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
|
|
||||||
@@ -30,6 +30,7 @@ class cap_sys_admin {
|
|||||||
public:
|
public:
|
||||||
cap_sys_admin() {
|
cap_sys_admin() {
|
||||||
caps = cap_get_proc();
|
caps = cap_get_proc();
|
||||||
|
|
||||||
cap_value_t sys_admin = CAP_SYS_ADMIN;
|
cap_value_t sys_admin = CAP_SYS_ADMIN;
|
||||||
if(cap_set_flag(caps, CAP_EFFECTIVE, 1, &sys_admin, CAP_SET) || cap_set_proc(caps)) {
|
if(cap_set_flag(caps, CAP_EFFECTIVE, 1, &sys_admin, CAP_SET) || cap_set_proc(caps)) {
|
||||||
BOOST_LOG(error) << "Failed to gain CAP_SYS_ADMIN";
|
BOOST_LOG(error) << "Failed to gain CAP_SYS_ADMIN";
|
||||||
|
|||||||
Reference in New Issue
Block a user