summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-09-12 15:17:50 +0200
committerGitHub <noreply@github.com>2023-09-12 15:17:50 +0200
commitce5320c49f6e3c1dc52b9046213366dd0df1612f (patch)
tree58d116258d42771a5ccda31775b127113b1ea256 /src
parentci: fix msvc when used with LTO (#11459) (diff)
parentadd a compile time option to allow disabling portable mode (diff)
downloadyuzu-ce5320c49f6e3c1dc52b9046213366dd0df1612f.tar
yuzu-ce5320c49f6e3c1dc52b9046213366dd0df1612f.tar.gz
yuzu-ce5320c49f6e3c1dc52b9046213366dd0df1612f.tar.bz2
yuzu-ce5320c49f6e3c1dc52b9046213366dd0df1612f.tar.lz
yuzu-ce5320c49f6e3c1dc52b9046213366dd0df1612f.tar.xz
yuzu-ce5320c49f6e3c1dc52b9046213366dd0df1612f.tar.zst
yuzu-ce5320c49f6e3c1dc52b9046213366dd0df1612f.zip
Diffstat (limited to 'src')
-rw-r--r--src/common/CMakeLists.txt4
-rw-r--r--src/common/fs/path_util.cpp6
2 files changed, 8 insertions, 2 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 6d2badf76..34877b461 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -151,6 +151,10 @@ add_library(common STATIC
zstd_compression.h
)
+if (YUZU_ENABLE_PORTABLE)
+ add_compile_definitions(YUZU_ENABLE_PORTABLE)
+endif()
+
if (WIN32)
target_sources(common PRIVATE
windows/timer_resolution.cpp
diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp
index d71cfacc6..dce219fcf 100644
--- a/src/common/fs/path_util.cpp
+++ b/src/common/fs/path_util.cpp
@@ -88,8 +88,9 @@ public:
fs::path yuzu_path_config;
#ifdef _WIN32
+#ifdef YUZU_ENABLE_PORTABLE
yuzu_path = GetExeDirectory() / PORTABLE_DIR;
-
+#endif
if (!IsDir(yuzu_path)) {
yuzu_path = GetAppDataRoamingDirectory() / YUZU_DIR;
}
@@ -101,8 +102,9 @@ public:
yuzu_path_cache = yuzu_path / CACHE_DIR;
yuzu_path_config = yuzu_path / CONFIG_DIR;
#else
+#ifdef YUZU_ENABLE_PORTABLE
yuzu_path = GetCurrentDir() / PORTABLE_DIR;
-
+#endif
if (Exists(yuzu_path) && IsDir(yuzu_path)) {
yuzu_path_cache = yuzu_path / CACHE_DIR;
yuzu_path_config = yuzu_path / CONFIG_DIR;