summaryrefslogtreecommitdiff
path: root/modules/mono/csharp_script.cpp
diff options
context:
space:
mode:
authorIgnacio Roldán Etcheverry <neikeq@users.noreply.github.com>2019-07-14 19:39:26 +0200
committerGitHub <noreply@github.com>2019-07-14 19:39:26 +0200
commit7f3490c5e118b10f444edd8e7e8cdbc85df84085 (patch)
tree27688ec1134ebd8a145882ece1fcd9aa361d93b9 /modules/mono/csharp_script.cpp
parent584ca0f156cec64c259382895e105cf27566a987 (diff)
parente59ac40712aa656e94072f0bdd60147c49b003aa (diff)
Merge pull request #30584 from neikeq/yatta
Mono: Better handling of missing/outdated API assemblies
Diffstat (limited to 'modules/mono/csharp_script.cpp')
-rw-r--r--modules/mono/csharp_script.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp
index 1add697997..078a490b22 100644
--- a/modules/mono/csharp_script.cpp
+++ b/modules/mono/csharp_script.cpp
@@ -114,15 +114,20 @@ void CSharpLanguage::init() {
gdmono = memnew(GDMono);
gdmono->initialize();
-#ifndef MONO_GLUE_ENABLED
- WARN_PRINT("This binary is built with `mono_glue=no` and cannot be used for scripting");
-#endif
-
#if defined(TOOLS_ENABLED) && defined(DEBUG_METHODS_ENABLED)
+ // Generate bindings here, before loading assemblies. `initialize_load_assemblies` aborts
+ // the applications if the api assemblies or the main tools assembly is missing, but this
+ // is not a problem for BindingsGenerator as it only needs the tools project editor assembly.
List<String> cmdline_args = OS::get_singleton()->get_cmdline_args();
BindingsGenerator::handle_cmdline_args(cmdline_args);
#endif
+#ifndef MONO_GLUE_ENABLED
+ print_line("Run this binary with `--generate-mono-glue path/to/modules/mono/glue`");
+#endif
+
+ gdmono->initialize_load_assemblies();
+
#ifdef TOOLS_ENABLED
EditorNode::add_init_callback(&_editor_init_callback);
@@ -710,14 +715,6 @@ bool CSharpLanguage::is_assembly_reloading_needed() {
return false; // No assembly to load
}
-#ifdef TOOLS_ENABLED
- if (!gdmono->get_core_api_assembly() && gdmono->metadata_is_api_assembly_invalidated(APIAssembly::API_CORE))
- return false; // The core API assembly to load is invalidated
-
- if (!gdmono->get_editor_api_assembly() && gdmono->metadata_is_api_assembly_invalidated(APIAssembly::API_EDITOR))
- return false; // The editor API assembly to load is invalidated
-#endif
-
return true;
}