From 4366d2973316a6c250a17cf9a170f187e2ed9f93 Mon Sep 17 00:00:00 2001 From: Yuri Konotopov Date: Sat, 17 Oct 2020 12:05:36 +0400 Subject: [PATCH] Added cmake options to bypass setcap execution. This call became a problem with distributions (eg Gentoo GNU/Linux) that builds PCSX2 in sandboxed environment which disallows setcap execution. Signed-off-by: Yuri Konotopov --- cmake/BuildParameters.cmake | 1 + pcsx2/CMakeLists.txt | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index 235bdb8e5..a3ff0041f 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -46,6 +46,7 @@ option(GSDX_LEGACY "Build a GSdx legacy plugin compatible with GL3.3") option(PACKAGE_MODE "Use this option to ease packaging of PCSX2 (developer/distribution option)") option(DISABLE_CHEATS_ZIP "Disable including the cheats_ws.zip file") option(DISABLE_PCSX2_WRAPPER "Disable including the PCSX2-linux.sh file") +option(DISABLE_SETCAP "Do not set files capabilities") option(XDG_STD "Use XDG standard path instead of the standard PCSX2 path") option(EXTRA_PLUGINS "Build various 'extra' plugins") option(SDL2_API "Use SDL2 on spu2x and onepad (wxWidget mustn't be built with SDL1.2 support" ON) diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index 6839089d7..6e129caca 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -739,9 +739,11 @@ endif() add_pcsx2_executable(${Output} "${pcsx2FinalSources}" "${pcsx2FinalLibs}" "${pcsx2FinalFlags}") if(dev9ghzdrk) - if(PACKAGE_MODE) - install(CODE "execute_process(COMMAND /bin/bash -c \"echo 'Enabling networking capability on Linux...';set -x; [ -f ${BIN_DIR}/${Output} ] && sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' ${BIN_DIR}/${Output}; set +x\")") - else() - install(CODE "execute_process(COMMAND /bin/bash -c \"echo 'Enabling networking capability on Linux...';set -x; [ -f ${CMAKE_SOURCE_DIR}/bin/${Output} ] && sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' ${CMAKE_SOURCE_DIR}/bin/${Output}; set +x\")") + if(NOT DISABLE_SETCAP) + if(PACKAGE_MODE) + install(CODE "execute_process(COMMAND /bin/bash -c \"echo 'Enabling networking capability on Linux...';set -x; [ -f ${BIN_DIR}/${Output} ] && sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' ${BIN_DIR}/${Output}; set +x\")") + else() + install(CODE "execute_process(COMMAND /bin/bash -c \"echo 'Enabling networking capability on Linux...';set -x; [ -f ${CMAKE_SOURCE_DIR}/bin/${Output} ] && sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' ${CMAKE_SOURCE_DIR}/bin/${Output}; set +x\")") + endif() endif() endif() -- 2.26.2