summaryrefslogtreecommitdiffstats
path: root/modules/mono/csharp_script.cpp
diff options
context:
space:
mode:
authorAndreia Gaita <shana@spoiledcat.net>2023-05-01 22:53:23 +0200
committerAndreia Gaita <shana@spoiledcat.net>2023-05-18 13:57:42 +0200
commite56fdc8a9a7180a099f637c97d764a6b3ad2d2eb (patch)
tree301d12ba5d6517729b7d05298e031f74af602f61 /modules/mono/csharp_script.cpp
parent1becfea37cd66ad0f13ba5770e5d5627b3fed23f (diff)
downloadredot-engine-e56fdc8a9a7180a099f637c97d764a6b3ad2d2eb.tar.gz
Skip initializing the C# runtime when generating glue bindings
The bindings generator doesn't require the C# runtime in order to generate the glue, and when it the glue generation runs, it exits immediately afterwards, so we can skip this initialization when the `--generate-mono-glue` flag is passed in. Fixes issue 75152
Diffstat (limited to 'modules/mono/csharp_script.cpp')
-rw-r--r--modules/mono/csharp_script.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp
index a77b1d83ad..0227039936 100644
--- a/modules/mono/csharp_script.cpp
+++ b/modules/mono/csharp_script.cpp
@@ -93,6 +93,12 @@ String CSharpLanguage::get_extension() const {
}
void CSharpLanguage::init() {
+#ifdef TOOLS_ENABLED
+ if (OS::get_singleton()->get_cmdline_args().find("--generate-mono-glue")) {
+ print_verbose(".NET: Skipping runtime initialization because glue generation is enabled.");
+ return;
+ }
+#endif
#ifdef DEBUG_METHODS_ENABLED
if (OS::get_singleton()->get_cmdline_args().find("--class-db-json")) {
class_db_api_to_json("user://class_db_api.json", ClassDB::API_CORE);