This commit is contained in:
OatmealDome 2026-05-07 02:34:59 -04:00 committed by GitHub
commit ea692562a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 19 additions and 5 deletions

View File

@ -150,6 +150,9 @@ if(UNIX)
# Builds a relocatable binary on Linux.
# The Sys folder will need to be copied to the Binaries folder.
option(LINUX_LOCAL_DEV "Enable relocatable binary" OFF)
# Builds for AppImage on Linux.
# Dolphin will find all resources using relative paths to the binary.
option(APPIMAGE "Builds for AppImage" OFF)
endif()
list(APPEND CMAKE_MODULE_PATH
@ -388,8 +391,14 @@ if(ENABLE_LTO)
endif()
if(UNIX)
if(LINUX_LOCAL_DEV AND APPIMAGE)
message(FATAL_ERROR "Can only specify one of LINUX_LOCAL_DEV and APPIMAGE")
endif()
if(LINUX_LOCAL_DEV)
add_definitions(-DLINUX_LOCAL_DEV)
elseif(APPIMAGE)
add_definitions(-DAPPIMAGE)
endif()
endif()
@ -846,11 +855,11 @@ endif()
if(CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD|OpenBSD")
# Install the application icon and menu item
install(FILES Data/dolphin-emu.svg
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps)
DESTINATION share/icons/hicolor/scalable/apps)
install(FILES Data/dolphin-emu.png
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/256x256/apps)
DESTINATION share/icons/hicolor/256x256/apps)
install(FILES Data/dolphin-emu.desktop
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
DESTINATION share/applications)
# Install manpages
install(FILES Data/dolphin-emu.6
DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)

View File

@ -759,7 +759,9 @@ std::string GetExeDirectory()
static std::string CreateSysDirectoryPath()
{
#if defined(_WIN32) || defined(LINUX_LOCAL_DEV)
#ifdef APPIMAGE
#define SYSDATA_DIR "../share/dolphin-emu/sys"
#elif defined(_WIN32) || defined(LINUX_LOCAL_DEV)
#define SYSDATA_DIR "Sys"
#elif defined __APPLE__
#define SYSDATA_DIR "Contents/Resources/Sys"
@ -773,7 +775,7 @@ static std::string CreateSysDirectoryPath()
#if defined(__APPLE__)
const std::string sys_directory = GetBundleDirectory() + DIR_SEP SYSDATA_DIR DIR_SEP;
#elif defined(_WIN32) || defined(LINUX_LOCAL_DEV)
#elif defined(_WIN32) || defined(LINUX_LOCAL_DEV) || defined(APPIMAGE)
const std::string sys_directory = GetExeDirectory() + DIR_SEP SYSDATA_DIR DIR_SEP;
#elif defined ANDROID
const std::string sys_directory = s_android_sys_directory + DIR_SEP;

View File

@ -280,6 +280,9 @@ static bool TryInstallTranslator(const QString& exact_language_code)
#elif defined __APPLE__
fmt::format("{}/Contents/Resources/{}.lproj/dolphin-emu.mo", File::GetBundleDirectory(),
lang)
#elif defined APPIMAGE
fmt::format("{}/../share/locale/{}/LC_MESSAGES/dolphin-emu.mo", File::GetExeDirectory(),
lang)
#elif defined LINUX_LOCAL_DEV
fmt::format("{}/../Source/Core/DolphinQt/{}/dolphin-emu.mo", File::GetExeDirectory(), lang)
#else