mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-09-18 10:50:05 +00:00
CMake: Unify sys directories
This commit is contained in:
+1
-1
@@ -839,7 +839,7 @@ add_subdirectory(Source)
|
|||||||
# Install shared data files
|
# Install shared data files
|
||||||
#
|
#
|
||||||
if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows")
|
if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows")
|
||||||
install(DIRECTORY Data/Sys/ DESTINATION ${datadir}/sys PATTERN)
|
install(DIRECTORY Data/Sys/ DESTINATION ${datadir}/Sys PATTERN)
|
||||||
endif()
|
endif()
|
||||||
if(NOT CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD|OpenBSD|Darwin")
|
if(NOT CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD|OpenBSD|Darwin")
|
||||||
install(FILES COPYING DESTINATION ${datadir})
|
install(FILES COPYING DESTINATION ${datadir})
|
||||||
|
|||||||
@@ -759,27 +759,27 @@ std::string GetExeDirectory()
|
|||||||
|
|
||||||
static std::string CreateSysDirectoryPath()
|
static std::string CreateSysDirectoryPath()
|
||||||
{
|
{
|
||||||
#if defined(_WIN32) || defined(LINUX_LOCAL_DEV)
|
#define SYS_FOLDER_NAME "Sys"
|
||||||
#define SYSDATA_DIR "Sys"
|
#if defined __APPLE__
|
||||||
#elif defined __APPLE__
|
#define SYSDATA_DIR "Contents/Resources/" SYS_FOLDER_NAME
|
||||||
#define SYSDATA_DIR "Contents/Resources/Sys"
|
|
||||||
#else
|
#else
|
||||||
#ifdef DATA_DIR
|
#define SYSDATA_DIR DATA_DIR SYS_FOLDER_NAME
|
||||||
#define SYSDATA_DIR DATA_DIR "sys"
|
|
||||||
#else
|
|
||||||
#define SYSDATA_DIR "sys"
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
std::string sys_directory;
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
const std::string sys_directory = GetBundleDirectory() + DIR_SEP SYSDATA_DIR DIR_SEP;
|
sys_directory = GetBundleDirectory() + DIR_SEP SYSDATA_DIR DIR_SEP;
|
||||||
#elif defined(_WIN32) || defined(LINUX_LOCAL_DEV)
|
|
||||||
const std::string sys_directory = GetExeDirectory() + DIR_SEP SYSDATA_DIR DIR_SEP;
|
|
||||||
#elif defined ANDROID
|
#elif defined ANDROID
|
||||||
const std::string sys_directory = s_android_sys_directory + DIR_SEP;
|
sys_directory = s_android_sys_directory + DIR_SEP;
|
||||||
ASSERT_MSG(COMMON, !s_android_sys_directory.empty(), "Sys directory has not been set");
|
ASSERT_MSG(COMMON, !s_android_sys_directory.empty(), "Sys directory has not been set");
|
||||||
#else
|
#else
|
||||||
const std::string sys_directory = SYSDATA_DIR DIR_SEP;
|
const std::string local_sys_directory = GetExeDirectory() + DIR_SEP SYS_FOLDER_NAME DIR_SEP;
|
||||||
|
if (IsDirectory(local_sys_directory))
|
||||||
|
sys_directory = local_sys_directory;
|
||||||
|
else
|
||||||
|
sys_directory = SYSDATA_DIR DIR_SEP;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
INFO_LOG_FMT(COMMON, "CreateSysDirectoryPath: Setting to {}", sys_directory);
|
INFO_LOG_FMT(COMMON, "CreateSysDirectoryPath: Setting to {}", sys_directory);
|
||||||
|
|||||||
Reference in New Issue
Block a user