summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorxcfrg <30675315+xcfrg@users.noreply.github.com>2023-09-07 00:53:39 +0200
committerxcfrg <30675315+xcfrg@users.noreply.github.com>2023-09-07 00:53:39 +0200
commita02d641042d031999f3b4b90a2b5190417e051c5 (patch)
treed4db0857d6b9e8ff0f80b67beaa7491eb3b71bd2 /src/common
parentMerge pull request #11427 from zhaobot/tx-update-20230901020727 (diff)
downloadyuzu-a02d641042d031999f3b4b90a2b5190417e051c5.tar
yuzu-a02d641042d031999f3b4b90a2b5190417e051c5.tar.gz
yuzu-a02d641042d031999f3b4b90a2b5190417e051c5.tar.bz2
yuzu-a02d641042d031999f3b4b90a2b5190417e051c5.tar.lz
yuzu-a02d641042d031999f3b4b90a2b5190417e051c5.tar.xz
yuzu-a02d641042d031999f3b4b90a2b5190417e051c5.tar.zst
yuzu-a02d641042d031999f3b4b90a2b5190417e051c5.zip
Diffstat (limited to 'src/common')
-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 bf97d9ba2..8b420873a 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;