diff options
| author | 2023-09-12 09:17:50 -0400 | |
|---|---|---|
| committer | 2023-09-12 09:17:50 -0400 | |
| commit | ce5320c49f6e3c1dc52b9046213366dd0df1612f (patch) | |
| tree | 58d116258d42771a5ccda31775b127113b1ea256 /src | |
| parent | ci: fix msvc when used with LTO (#11459) (diff) | |
| parent | add a compile time option to allow disabling portable mode (diff) | |
| download | yuzu-ce5320c49f6e3c1dc52b9046213366dd0df1612f.tar.gz yuzu-ce5320c49f6e3c1dc52b9046213366dd0df1612f.tar.xz yuzu-ce5320c49f6e3c1dc52b9046213366dd0df1612f.zip | |
Merge pull request #11447 from xcfrg/portable-compile-out
common: add a compile time option to allow disabling portable mode
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | src/common/fs/path_util.cpp | 6 |
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 | |||
| 151 | zstd_compression.h | 151 | zstd_compression.h |
| 152 | ) | 152 | ) |
| 153 | 153 | ||
| 154 | if (YUZU_ENABLE_PORTABLE) | ||
| 155 | add_compile_definitions(YUZU_ENABLE_PORTABLE) | ||
| 156 | endif() | ||
| 157 | |||
| 154 | if (WIN32) | 158 | if (WIN32) |
| 155 | target_sources(common PRIVATE | 159 | target_sources(common PRIVATE |
| 156 | windows/timer_resolution.cpp | 160 | 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: | |||
| 88 | fs::path yuzu_path_config; | 88 | fs::path yuzu_path_config; |
| 89 | 89 | ||
| 90 | #ifdef _WIN32 | 90 | #ifdef _WIN32 |
| 91 | #ifdef YUZU_ENABLE_PORTABLE | ||
| 91 | yuzu_path = GetExeDirectory() / PORTABLE_DIR; | 92 | yuzu_path = GetExeDirectory() / PORTABLE_DIR; |
| 92 | 93 | #endif | |
| 93 | if (!IsDir(yuzu_path)) { | 94 | if (!IsDir(yuzu_path)) { |
| 94 | yuzu_path = GetAppDataRoamingDirectory() / YUZU_DIR; | 95 | yuzu_path = GetAppDataRoamingDirectory() / YUZU_DIR; |
| 95 | } | 96 | } |
| @@ -101,8 +102,9 @@ public: | |||
| 101 | yuzu_path_cache = yuzu_path / CACHE_DIR; | 102 | yuzu_path_cache = yuzu_path / CACHE_DIR; |
| 102 | yuzu_path_config = yuzu_path / CONFIG_DIR; | 103 | yuzu_path_config = yuzu_path / CONFIG_DIR; |
| 103 | #else | 104 | #else |
| 105 | #ifdef YUZU_ENABLE_PORTABLE | ||
| 104 | yuzu_path = GetCurrentDir() / PORTABLE_DIR; | 106 | yuzu_path = GetCurrentDir() / PORTABLE_DIR; |
| 105 | 107 | #endif | |
| 106 | if (Exists(yuzu_path) && IsDir(yuzu_path)) { | 108 | if (Exists(yuzu_path) && IsDir(yuzu_path)) { |
| 107 | yuzu_path_cache = yuzu_path / CACHE_DIR; | 109 | yuzu_path_cache = yuzu_path / CACHE_DIR; |
| 108 | yuzu_path_config = yuzu_path / CONFIG_DIR; | 110 | yuzu_path_config = yuzu_path / CONFIG_DIR; |