VERY experimental Nintendo Switch 2 emulator
C++
add a compile time option to allow disabling portable mode
xcfrg6178343f3fe4
diff --git a/CMakeLists.txt b/CMakeLists.txtindex 4039c680e8..9b39b295fa 100644--- a/CMakeLists.txt+++ b/CMakeLists.txt@@ -61,6 +61,8 @@ option(YUZU_ENABLE_LTO "Enable link-time optimization" OFF)option(YUZU_DOWNLOAD_TIME_ZONE_DATA "Always download time zone binaries" OFF)+option(YUZU_ENABLE_PORTABLE "Allow yuzu to enable portable mode if a user folder is found in the CWD" ON)+CMAKE_DEPENDENT_OPTION(YUZU_USE_FASTER_LD "Check if a faster linker is available" ON "NOT WIN32" OFF)CMAKE_DEPENDENT_OPTION(USE_SYSTEM_MOLTENVK "Use the system MoltenVK lib (instead of the bundled one)" OFF "APPLE" OFF)diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txtindex bf97d9ba28..8b420873a7 100644--- a/src/common/CMakeLists.txt+++ b/src/common/CMakeLists.txt@@ -151,6 +151,10 @@ add_library(common STATICzstd_compression.h)+if (YUZU_ENABLE_PORTABLE)+ add_compile_definitions(YUZU_ENABLE_PORTABLE)+endif()+if (WIN32)target_sources(common PRIVATEwindows/timer_resolution.cppdiff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cppindex d71cfacc6a..dce219fcf8 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_PORTABLEyuzu_path = GetExeDirectory() / PORTABLE_DIR;-+#endifif (!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_PORTABLEyuzu_path = GetCurrentDir() / PORTABLE_DIR;-+#endifif (Exists(yuzu_path) && IsDir(yuzu_path)) {yuzu_path_cache = yuzu_path / CACHE_DIR;yuzu_path_config = yuzu_path / CONFIG_DIR;