summaryrefslogtreecommitdiffstats
path: root/modules/mono/mono_gd/gd_mono.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-07-03 21:26:12 +0200
committerGitHub <noreply@github.com>2019-07-03 21:26:12 +0200
commite1478b7a87c1eec7bcf3438d0894cf4fe0135db2 (patch)
treeaf3611d72ff8ec0a6328af6b22e691ab854cb27e /modules/mono/mono_gd/gd_mono.cpp
parent2832c5aa94009c757ca9ba94489e158886205f5b (diff)
parent9f1a8ce6a296868103b84c178375d3f82d9aa963 (diff)
downloadredot-engine-e1478b7a87c1eec7bcf3438d0894cf4fe0135db2.tar.gz
Merge pull request #30292 from neikeq/android_fixes
Mono: Android build and shared libraries fixes
Diffstat (limited to 'modules/mono/mono_gd/gd_mono.cpp')
-rw-r--r--modules/mono/mono_gd/gd_mono.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp
index 7699e0d0cd..c90da31f3a 100644
--- a/modules/mono/mono_gd/gd_mono.cpp
+++ b/modules/mono/mono_gd/gd_mono.cpp
@@ -56,6 +56,10 @@
#include "main/main.h"
#endif
+#ifdef ANDROID_ENABLED
+#include "android_mono_config.gen.h"
+#endif
+
#define OUT_OF_SYNC_ERR_MESSAGE(m_assembly_name) "The assembly '" m_assembly_name "' is out of sync. " \
"This error is expected if you just upgraded to a newer Godot version. " \
"Building the project will update the assembly to the correct version."
@@ -287,7 +291,11 @@ void GDMono::initialize() {
gdmono_debug_init();
#endif
+#ifdef ANDROID_ENABLED
+ mono_config_parse_memory(get_godot_android_mono_config().utf8().get_data());
+#else
mono_config_parse(NULL);
+#endif
mono_install_unhandled_exception_hook(&unhandled_exception_hook, NULL);
@@ -651,12 +659,13 @@ bool GDMono::_load_project_assembly() {
if (project_assembly)
return true;
- String name = ProjectSettings::get_singleton()->get("application/config/name");
- if (name.empty()) {
- name = "UnnamedProject";
+ String appname = ProjectSettings::get_singleton()->get("application/config/name");
+ String appname_safe = OS::get_singleton()->get_safe_dir_name(appname);
+ if (appname_safe.empty()) {
+ appname_safe = "UnnamedProject";
}
- bool success = load_assembly(name, &project_assembly);
+ bool success = load_assembly(appname_safe, &project_assembly);
if (success) {
mono_assembly_set_main(project_assembly->get_assembly());