mirror of https://git.suyu.dev/suyu/suyu
Merge pull request #12234 from abouvier/unbundle-gamemode
cmake: prefer system gamemode library
This commit is contained in:
commit
3c45ba1c22
|
@ -151,3 +151,7 @@ License: GPL-3.0-or-later
|
||||||
Files: externals/stb/*
|
Files: externals/stb/*
|
||||||
Copyright: Sean Barrett
|
Copyright: Sean Barrett
|
||||||
License: MIT
|
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)
|
find_package(OpenSSL 1.1.1 REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (UNIX AND NOT APPLE)
|
||||||
|
find_package(gamemode 1.7 MODULE)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Please consider this as a stub
|
# Please consider this as a stub
|
||||||
if(ENABLE_QT6 AND Qt6_LOCATION)
|
if(ENABLE_QT6 AND Qt6_LOCATION)
|
||||||
list(APPEND CMAKE_PREFIX_PATH "${Qt6_LOCATION}")
|
list(APPEND CMAKE_PREFIX_PATH "${Qt6_LOCATION}")
|
||||||
|
|
|
@ -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()
|
|
@ -193,8 +193,10 @@ if (ANDROID)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (UNIX AND NOT APPLE)
|
if (UNIX AND NOT APPLE AND NOT TARGET gamemode::headers)
|
||||||
add_subdirectory(gamemode)
|
add_library(gamemode INTERFACE)
|
||||||
|
target_include_directories(gamemode INTERFACE gamemode)
|
||||||
|
add_library(gamemode::headers ALIAS gamemode)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Breakpad
|
# Breakpad
|
||||||
|
|
|
@ -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
|
Copyright (c) 2017-2019, Feral Interactive
|
|
@ -188,7 +188,7 @@ if (UNIX AND NOT APPLE)
|
||||||
linux/gamemode.h
|
linux/gamemode.h
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(common PRIVATE gamemode)
|
target_link_libraries(common PRIVATE gamemode::headers)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ARCHITECTURE_x86_64)
|
if(ARCHITECTURE_x86_64)
|
||||||
|
|
|
@ -386,7 +386,7 @@ if (NOT WIN32)
|
||||||
target_include_directories(yuzu PRIVATE ${Qt${QT_MAJOR_VERSION}Gui_PRIVATE_INCLUDE_DIRS})
|
target_include_directories(yuzu PRIVATE ${Qt${QT_MAJOR_VERSION}Gui_PRIVATE_INCLUDE_DIRS})
|
||||||
endif()
|
endif()
|
||||||
if (UNIX AND NOT APPLE)
|
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()
|
endif()
|
||||||
|
|
||||||
target_compile_definitions(yuzu PRIVATE
|
target_compile_definitions(yuzu PRIVATE
|
||||||
|
|
Loading…
Reference in New Issue