mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
Add Launcher_ENABLE_GAMEMODE CMake flag
Signed-off-by: cat <cat@plan9.rocks>
This commit is contained in:
parent
194b72f180
commit
072d5419eb
4 changed files with 11 additions and 4 deletions
|
|
@ -303,7 +303,9 @@ endif()
|
|||
|
||||
find_package(cmark REQUIRED)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
option(Launcher_ENABLE_GAMEMODE "Enable Feral Gamemode support" ON)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND Launcher_ENABLE_GAMEMODE)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(gamemode REQUIRED IMPORTED_TARGET gamemode)
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -131,8 +131,10 @@
|
|||
#ifdef Q_OS_LINUX
|
||||
#include <dlfcn.h>
|
||||
#include "LibraryUtils.h"
|
||||
#ifdef ENABLE_GAMEMODE
|
||||
#include "gamemode_client.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_LINUX)
|
||||
#include <sys/statvfs.h>
|
||||
|
|
@ -1837,8 +1839,10 @@ void Application::updateCapabilities()
|
|||
m_capabilities |= SupportsFlame;
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#ifdef ENABLE_GAMEMODE
|
||||
if (gamemode_query_status() >= 0)
|
||||
m_capabilities |= SupportsGameMode;
|
||||
#endif
|
||||
|
||||
if (!LibraryUtils::findMangoHud().isEmpty())
|
||||
m_capabilities |= SupportsMangoHud;
|
||||
|
|
|
|||
|
|
@ -1356,10 +1356,11 @@ else()
|
|||
target_link_libraries(Launcher_logic LibArchive::LibArchive)
|
||||
endif()
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND Launcher_ENABLE_GAMEMODE)
|
||||
target_link_libraries(Launcher_logic
|
||||
gamemode
|
||||
)
|
||||
add_compile_definitions(ENABLE_GAMEMODE)
|
||||
endif()
|
||||
|
||||
target_link_libraries(Launcher_logic
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
#include "launch/LaunchTask.h"
|
||||
#include "minecraft/MinecraftInstance.h"
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#if defined(Q_OS_LINUX) && ENABLE_GAMEMODE
|
||||
#include "gamemode_client.h"
|
||||
#endif
|
||||
|
||||
|
|
@ -149,7 +149,7 @@ void LauncherPartLaunch::executeTask()
|
|||
m_process.start(javaPath, args);
|
||||
}
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#if defined(Q_OS_LINUX) && ENABLE_GAMEMODE
|
||||
if (instance->settings()->get("EnableFeralGamemode").toBool() && APPLICATION->capabilities() & Application::SupportsGameMode) {
|
||||
auto pid = m_process.processId();
|
||||
if (pid) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue