Переглянути джерело

UI: Only set portable mode variable if supported

Previously, all the functions of portable mode wouldn't work if compiled
without it, but the log still show it as enabled if the argument was
set. This could lead to confusion.
Additionally, we don't even show the option in the help string (--help),
so it should just be a no-op.
gxalpha 2 роки тому
батько
коміт
d405193aeb
1 змінених файлів з 6 додано та 4 видалено
  1. 6 4
      UI/obs-app.cpp

+ 6 - 4
UI/obs-app.cpp

@@ -3222,12 +3222,14 @@ int main(int argc, char *argv[])
 	obs_set_cmdline_args(argc, argv);
 
 	for (int i = 1; i < argc; i++) {
-		if (arg_is(argv[i], "--portable", "-p")) {
-			portable_mode = true;
-
-		} else if (arg_is(argv[i], "--multi", "-m")) {
+		if (arg_is(argv[i], "--multi", "-m")) {
 			multi = true;
 
+#if ALLOW_PORTABLE_MODE
+		} else if (arg_is(argv[i], "--portable", "-p")) {
+			portable_mode = true;
+
+#endif
 		} else if (arg_is(argv[i], "--verbose", nullptr)) {
 			log_verbose = true;