From 48bff0620293bae4c9540a318d9ae449315a5807 Mon Sep 17 00:00:00 2001 From: Yuri Konotopov Date: Fri, 30 Oct 2020 09:25:41 +0400 Subject: [PATCH] Added cmake options to bypass setcap execution. (#3840) 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 | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index 195315e12e..354a49fccb 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -42,6 +42,7 @@ option(BUILD_REPLAY_LOADERS "Build GS replayer to ease testing (developer option 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(PORTAUDIO_API "Build portaudio support on spu2x" ON) diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index 2b0db9fb73..7df58ba2a9 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -877,9 +877,11 @@ if (APPLE) endif() 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() \ No newline at end of file +endif()