mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-07-04 23:31:19 +01:00
Merge pull request #12234 from abouvier/unbundle-gamemode
cmake: prefer system gamemode library
This commit is contained in:
commit
3c45ba1c22
8 changed files with 29 additions and 18 deletions
|
@ -151,3 +151,7 @@ License: GPL-3.0-or-later
|
|||
Files: externals/stb/*
|
||||
Copyright: Sean Barrett
|
||||
License: MIT
|
||||
|
||||
Files: externals/gamemode/*
|
||||
Copyright: Copyright 2017-2019 Feral Interactive
|
||||
License: BSD-3-Clause
|
||||
|
|
|
@ -343,6 +343,10 @@ if(ENABLE_OPENSSL)
|
|||
find_package(OpenSSL 1.1.1 REQUIRED)
|
||||
endif()
|
||||
|
||||
if (UNIX AND NOT APPLE)
|
||||
find_package(gamemode 1.7 MODULE)
|
||||
endif()
|
||||
|
||||
# Please consider this as a stub
|
||||
if(ENABLE_QT6 AND Qt6_LOCATION)
|
||||
list(APPEND CMAKE_PREFIX_PATH "${Qt6_LOCATION}")
|
||||
|
|
15
CMakeModules/Findgamemode.cmake
Normal file
15
CMakeModules/Findgamemode.cmake
Normal file
|
@ -0,0 +1,15 @@
|
|||
# SPDX-FileCopyrightText: 2023 yuzu Emulator Project
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_search_module(GAMEMODE QUIET IMPORTED_TARGET gamemode)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(gamemode
|
||||
REQUIRED_VARS GAMEMODE_INCLUDEDIR
|
||||
VERSION_VAR GAMEMODE_VERSION
|
||||
)
|
||||
|
||||
if (gamemode_FOUND AND NOT TARGET gamemode::headers)
|
||||
add_library(gamemode::headers ALIAS PkgConfig::GAMEMODE)
|
||||
endif()
|
6
externals/CMakeLists.txt
vendored
6
externals/CMakeLists.txt
vendored
|
@ -193,8 +193,10 @@ if (ANDROID)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if (UNIX AND NOT APPLE)
|
||||
add_subdirectory(gamemode)
|
||||
if (UNIX AND NOT APPLE AND NOT TARGET gamemode::headers)
|
||||
add_library(gamemode INTERFACE)
|
||||
target_include_directories(gamemode INTERFACE gamemode)
|
||||
add_library(gamemode::headers ALIAS gamemode)
|
||||
endif()
|
||||
|
||||
# Breakpad
|
||||
|
|
11
externals/gamemode/CMakeLists.txt
vendored
11
externals/gamemode/CMakeLists.txt
vendored
|
@ -1,11 +0,0 @@
|
|||
# SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
project(gamemode LANGUAGES CXX C)
|
||||
|
||||
add_library(gamemode include/gamemode_client.h)
|
||||
|
||||
target_link_libraries(gamemode PRIVATE common)
|
||||
|
||||
target_include_directories(gamemode PUBLIC include)
|
||||
set_target_properties(gamemode PROPERTIES LINKER_LANGUAGE C)
|
|
@ -1,6 +1,3 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2017-2019 Feral Interactive
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2017-2019, Feral Interactive
|
|
@ -188,7 +188,7 @@ if (UNIX AND NOT APPLE)
|
|||
linux/gamemode.h
|
||||
)
|
||||
|
||||
target_link_libraries(common PRIVATE gamemode)
|
||||
target_link_libraries(common PRIVATE gamemode::headers)
|
||||
endif()
|
||||
|
||||
if(ARCHITECTURE_x86_64)
|
||||
|
|
|
@ -386,7 +386,7 @@ if (NOT WIN32)
|
|||
target_include_directories(yuzu PRIVATE ${Qt${QT_MAJOR_VERSION}Gui_PRIVATE_INCLUDE_DIRS})
|
||||
endif()
|
||||
if (UNIX AND NOT APPLE)
|
||||
target_link_libraries(yuzu PRIVATE Qt${QT_MAJOR_VERSION}::DBus gamemode)
|
||||
target_link_libraries(yuzu PRIVATE Qt${QT_MAJOR_VERSION}::DBus)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(yuzu PRIVATE
|
||||
|
|
Loading…
Reference in a new issue