From d88103172c4209f9adb98a1341133df5ba016ed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 13 Jan 2020 13:55:54 +0100 Subject: [PATCH] Ignore command line --build-solutions when not editing project This option is meant to use together with `--path` or from a project folder. Otherwise the project manager is opened and the option triggers a crash. Fixes #25589. --- main/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main/main.cpp b/main/main.cpp index 7015902e199..2f924518441 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -292,7 +292,7 @@ void Main::print_help(const char *p_binary) { OS::get_singleton()->print(" --export-pack Same as --export, but only export the game pack for the given preset. The extension determines whether it will be in PCK or ZIP format.\n"); OS::get_singleton()->print(" --doctool Dump the engine API reference to the given in XML format, merging if existing files are found.\n"); OS::get_singleton()->print(" --no-docbase Disallow dumping the base types (used with --doctool).\n"); - OS::get_singleton()->print(" --build-solutions Build the scripting solutions (e.g. for C# projects).\n"); + OS::get_singleton()->print(" --build-solutions Build the scripting solutions (e.g. for C# projects). Implies --editor and requires a valid project to edit.\n"); #ifdef DEBUG_METHODS_ENABLED OS::get_singleton()->print(" --gdnative-generate-json-api Generate JSON dump of the Godot API for GDNative bindings.\n"); #endif @@ -2112,8 +2112,12 @@ bool Main::iteration() { #ifdef TOOLS_ENABLED if (auto_build_solutions) { auto_build_solutions = false; + // Only relevant when running the editor. + if (!editor) { + ERR_FAIL_V_MSG(true, "Command line option --build-solutions was passed, but no project is being edited. Aborting."); + } if (!EditorNode::get_singleton()->call_build()) { - ERR_FAIL_V(true); + ERR_FAIL_V_MSG(true, "Command line option --build-solutions was passed, but the build callback failed. Aborting."); } } #endif