builds godot
try new patch
| -rw-r--r-- | .github/2d-build-modules.py | 4 | ||||
| -rw-r--r-- | patches/no-arg-handling.patch | 263 |
2 files changed, 216 insertions, 51 deletions
diff --git a/.github/2d-build-modules.py b/.github/2d-build-modules.py index 0dbfd2e..1dc359e 100644 --- a/.github/2d-build-modules.py +++ b/.github/2d-build-modules.py @@ -5,7 +5,7 @@ deprecated = "no" execinfo = "no" fontconfig = "yes" # system fonts graphite = "yes" -lto = "all" +lto = "auto" minizip = "no" # zip support module_astcenc_enabled = "no" # adaptive scalable data compression format module_basis_universal_enabled = "yes" @@ -42,7 +42,7 @@ module_ogg_enabled = "yes" module_raycast_enabled = "no" # lightmap raytracing module_regex_enabled = "yes" module_squish_enabled = "yes" # S3TC lossy compression format -module_svg_enabled = "no" # the svg support is bad, just prerender +module_svg_enabled = "yes" # svg is necessary for editor module_text_server_fb_enabled = "no" # the text server module_text_server_adv_enabled = "yes" # the cooler text server module_tga_enabled = "no" # more image formats diff --git a/patches/no-arg-handling.patch b/patches/no-arg-handling.patch index 3aea52c..027f95f 100644 --- a/patches/no-arg-handling.patch +++ b/patches/no-arg-handling.patch @@ -1,29 +1,67 @@ +diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml +index 47f39aedf4..d020f52d74 100644 +--- a/doc/classes/OS.xml ++++ b/doc/classes/OS.xml +@@ -176,7 +176,7 @@ + } + [/csharp] + [/codeblocks] +- [b]Note:[/b] Passing custom user arguments directly is not recommended, as the engine may discard or modify them. Instead, the best way is to use the standard UNIX double dash ([code]--[/code]) and then pass custom arguments, which the engine itself will ignore. These can be read via [method get_cmdline_user_args]. ++ [b]Note:[/b] Most arguments will be ignored by godot in release templates, so passing custom user args will be safe. If you want to pass engine arguments like `--rendering-driver`, use the standard UNIX double dash ([code]--[/code]), and then pass your arguments, which the engine will then ignore. Arguments after [code]--[/code] are then accessible via [method get_cmdline_user_args]. + </description> + </method> + <method name="get_cmdline_user_args"> +@@ -185,9 +185,9 @@ + Similar to [method get_cmdline_args], but this returns the user arguments (any argument passed after the double dash [code]--[/code] or double plus [code]++[/code] argument). These are left untouched by Godot for the user. [code]++[/code] can be used in situations where [code]--[/code] is intercepted by another program (such as [code]startx[/code]). + For example, in the command line below, [code]--fullscreen[/code] will not be returned in [method get_cmdline_user_args] and [code]--level 1[/code] will only be returned in [method get_cmdline_user_args]: + [codeblock] +- godot --fullscreen -- --level 1 ++ godot --display-driver vulkan -- --level 1 + # Or: +- godot --fullscreen ++ --level 1 ++ godot --display-driver vulkan ++ --level 1 + [/codeblock] + </description> + </method> diff --git a/main/main.cpp b/main/main.cpp -index 5e0187cc7f..f57985fb32 100644 +index 5e0187cc7f..1f3b8aec6f 100644 --- a/main/main.cpp +++ b/main/main.cpp -@@ -166,10 +166,10 @@ static bool editor = false; +@@ -166,19 +166,20 @@ static bool editor = false; static bool project_manager = false; static bool cmdline_tool = false; static String locale; -static bool show_help = false; -static uint64_t quit_after = 0; static OS::ProcessID editor_pid = 0; - #ifdef TOOLS_ENABLED ++#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED) +static uint64_t quit_after = 0; +static bool show_help = false; ++static String debug_server_uri; ++#endif + #ifdef TOOLS_ENABLED ++HashMap<Main::CLIScope, Vector<String>> forwardable_cli_arguments; static bool found_project = false; static bool auto_build_solutions = false; - static String debug_server_uri; -@@ -331,6 +331,7 @@ void finalize_theme_db() { +-static String debug_server_uri; + #ifndef DISABLE_DEPRECATED + static int converter_max_kb_file = 4 * 1024; // 4MB + static int converter_max_line_length = 100000; + #endif // DISABLE_DEPRECATED +- +-HashMap<Main::CLIScope, Vector<String>> forwardable_cli_arguments; + #endif + bool use_startup_benchmark = false; + String startup_benchmark_file; +@@ -331,6 +332,7 @@ void finalize_theme_db() { #define MAIN_PRINT(m_txt) #endif -+#ifdef TOOLS_ENABLED ++#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED) void Main::print_help(const char *p_binary) { print_line(String(VERSION_NAME) + " v" + get_full_version_string() + " - " + String(VERSION_WEBSITE)); OS::get_singleton()->print("Free and open source software under the terms of the MIT license.\n"); -@@ -468,6 +469,7 @@ void Main::print_help(const char *p_binary) { +@@ -468,6 +470,7 @@ void Main::print_help(const char *p_binary) { #endif OS::get_singleton()->print("\n"); } @@ -31,42 +69,178 @@ index 5e0187cc7f..f57985fb32 100644 #ifdef TESTS_ENABLED // The order is the same as in `Main::setup()`, only core and some editor types -@@ -721,7 +723,9 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph - List<String> args; - List<String> main_args; - List<String> user_args; -+#ifdef TOOLS_ENABLED - bool adding_user_args = false; +@@ -818,25 +821,26 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph + + if (adding_user_args) { + user_args.push_back(I->get()); +- } else if (I->get() == "-h" || I->get() == "--help" || I->get() == "/?") { // display help ++ } ++#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED) ++ else if (I->get() == "-h" || I->get() == "--help" || I->get() == "/?") { // display help + + show_help = true; + exit_code = ERR_HELP; // Hack to force an early exit in `main()` with a success code. + goto error; +- + } else if (I->get() == "--version") { + print_line(get_full_version_string()); + exit_code = ERR_HELP; // Hack to force an early exit in `main()` with a success code. + goto error; +- + } else if (I->get() == "-v" || I->get() == "--verbose") { // verbose output + + OS::get_singleton()->_verbose_stdout = true; + } else if (I->get() == "-q" || I->get() == "--quiet") { // quieter output + + quiet_stdout = true; +- +- } else if (I->get() == "--audio-driver") { // audio driver ++ } ++#endif // important args ++ else if (I->get() == "--audio-driver") { // audio driver + + if (I->next()) { + audio_driver = I->next()->get(); +@@ -952,12 +956,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph + OS::get_singleton()->print("Missing GPU index argument, aborting.\n"); + goto error; + } +- } else if (I->get() == "--gpu-validation") { +- Engine::singleton->use_validation_layers = true; +-#ifdef DEBUG_ENABLED +- } else if (I->get() == "--gpu-abort") { +- Engine::singleton->abort_on_gpu_errors = true; +-#endif + } else if (I->get() == "--tablet-driver") { + if (I->next()) { + tablet_driver = I->next()->get(); +@@ -966,7 +964,16 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph + OS::get_singleton()->print("Missing tablet driver argument, aborting.\n"); + goto error; + } +- } else if (I->get() == "--single-window") { // force single window ++ } ++#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED) ++#ifdef DEBUG_ENABLED ++ else if (I->get() == "--gpu-validation") { ++ Engine::singleton->use_validation_layers = true; ++ } else if (I->get() == "--gpu-abort") { ++ Engine::singleton->abort_on_gpu_errors = true; ++ } +#endif - List<String> platform_args = OS::get_singleton()->get_cmdline_platform_args(); ++ else if (I->get() == "--single-window") { // force single window - // Add command line arguments. -@@ -816,6 +820,19 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph - } - #endif + single_window = true; + } else if (I->get() == "-t" || I->get() == "--always-on-top") { // force always-on-top window +@@ -1002,7 +1009,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph + OS::get_singleton()->print("Missing resolution argument, aborting.\n"); + goto error; + } +- + } else if (I->get() == "--screen") { // set window screen -+#ifndef TOOLS_ENABLED -+ if (I->get() == "--main-pack") { -+ if (I->next()) { -+ main_pack = I->next()->get(); -+ N = I->next()->next(); -+ } else { -+ OS::get_singleton()->print("Missing path to main pack file, aborting.\n"); -+ goto error; -+ }; -+ } else { -+ user_args.push_back(I->get()); + if (I->next()) { +@@ -1014,7 +1020,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph + OS::get_singleton()->print("Missing screen argument, aborting.\n"); + goto error; + } +- + } else if (I->get() == "--position") { // set window position + + if (I->next()) { +@@ -1038,16 +1043,13 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph + OS::get_singleton()->print("Missing position argument, aborting.\n"); + goto error; + } +- + } else if (I->get() == "--headless") { // enable headless mode (no audio, no rendering). + + audio_driver = NULL_AUDIO_DRIVER; + display_driver = NULL_DISPLAY_DRIVER; +- + } else if (I->get() == "--profiling") { // enable profiling + + use_debug_profiler = true; +- + } else if (I->get() == "-l" || I->get() == "--language") { // language + + if (I->next()) { +@@ -1057,7 +1059,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph + OS::get_singleton()->print("Missing language argument, aborting.\n"); + goto error; + } +- + } else if (I->get() == "--remote-fs") { // remote filesystem + + if (I->next()) { +@@ -1238,7 +1239,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph + OS::get_singleton()->print("Missing list of breakpoints, aborting.\n"); + goto error; + } +- + } else if (I->get() == "--frame-delay") { // force frame delay + + if (I->next()) { +@@ -1248,7 +1248,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph + OS::get_singleton()->print("Missing frame delay argument, aborting.\n"); + goto error; + } +- + } else if (I->get() == "--time-scale") { // force time scale + + if (I->next()) { +@@ -1258,8 +1257,9 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph + OS::get_singleton()->print("Missing time scale argument, aborting.\n"); + goto error; + } +- +- } else if (I->get() == "--main-pack") { + } -+#else - if (adding_user_args) { - user_args.push_back(I->get()); - } else if (I->get() == "-h" || I->get() == "--help" || I->get() == "/?") { // display help -@@ -1370,18 +1387,15 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph ++#endif // essential arg for html builds ++ else if (I->get() == "--main-pack") { + if (I->next()) { + main_pack = I->next()->get(); + N = I->next()->next(); +@@ -1267,12 +1267,14 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph + OS::get_singleton()->print("Missing path to main pack file, aborting.\n"); + goto error; + }; +- +- } else if (I->get() == "-d" || I->get() == "--debug") { ++ } ++#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED) ++ else if (I->get() == "-d" || I->get() == "--debug") { + debug_uri = "local://"; + OS::get_singleton()->_debug_stdout = true; ++ } + #if defined(DEBUG_ENABLED) +- } else if (I->get() == "--debug-collisions") { ++ else if (I->get() == "--debug-collisions") { + debug_collisions = true; + } else if (I->get() == "--debug-paths") { + debug_paths = true; +@@ -1352,7 +1354,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph + OS::get_singleton()->print("Missing --xr-mode argument, aborting.\n"); + goto error; + } +- + } else if (I->get() == "--startup-benchmark") { + use_startup_benchmark = true; + } else if (I->get() == "--startup-benchmark-file") { +@@ -1364,24 +1365,21 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph + OS::get_singleton()->print("Missing <path> argument for --startup-benchmark-file <path>.\n"); + goto error; + } +- +- } else if (I->get() == "--" || I->get() == "++") { ++ } ++#endif ++ else if (I->get() == "--" || I->get() == "++") { + adding_user_args = true; } else { main_args.push_back(I->get()); } - -+#endif I = N; } - @@ -81,7 +255,7 @@ index 5e0187cc7f..f57985fb32 100644 // Network file system needs to be configured before globals, since globals are based on the // 'project.godot' file which will only be available through the network if this is enabled FileAccessNetwork::configure(); -@@ -1403,7 +1417,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph +@@ -1403,7 +1401,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph FileAccess::make_default<FileAccessNetwork>(FileAccess::ACCESS_RESOURCES); } @@ -90,11 +264,11 @@ index 5e0187cc7f..f57985fb32 100644 if (globals->setup(project_path, main_pack, upwards, editor) == OK) { #ifdef TOOLS_ENABLED found_project = true; -@@ -1910,9 +1924,11 @@ error: +@@ -1910,9 +1908,11 @@ error: args.clear(); main_args.clear(); -+#ifdef TOOLS_ENABLED ++#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED) if (show_help) { print_help(execpath); } @@ -102,20 +276,11 @@ index 5e0187cc7f..f57985fb32 100644 EngineDebugger::deinitialize(); -@@ -1961,7 +1977,7 @@ Error Main::setup2() { - Thread::make_main_thread(); // Make whatever thread call this the main thread. - - // Print engine name and version -- print_line(String(VERSION_NAME) + " v" + get_full_version_string() + " - " + String(VERSION_WEBSITE)); -+ print_line("v" + get_full_version_string()); - - engine->startup_benchmark_begin_measure("servers"); - -@@ -3311,9 +3327,11 @@ bool Main::iteration() { +@@ -3311,9 +3311,11 @@ bool Main::iteration() { movie_writer->add_frame(vp_tex); } -+#ifdef TOOLS_ENABLED ++#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED) if ((quit_after > 0) && (Engine::get_singleton()->_process_frames >= quit_after)) { exit = true; } |