From bc8b61bb069a9229dbceb61fedb8308c5d1e6a68 Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Tue, 22 Jan 2019 18:33:36 +0100 Subject: [PATCH] Mono: Fix hot reload build errors and cleanup --- modules/mono/SCsub | 3 +++ modules/mono/csharp_script.cpp | 21 +++++++++++++++++---- modules/mono/csharp_script.h | 11 ++++------- modules/mono/mono_gd/gd_mono.cpp | 18 +++++++++++++++--- modules/mono/mono_gd/gd_mono.h | 4 +++- modules/mono/utils/osx_utils.h | 1 + 6 files changed, 43 insertions(+), 15 deletions(-) diff --git a/modules/mono/SCsub b/modules/mono/SCsub index e1f5e2ef28b..706949154e0 100644 --- a/modules/mono/SCsub +++ b/modules/mono/SCsub @@ -88,6 +88,9 @@ vars.Update(env_mono) if env_mono['mono_glue']: env_mono.Append(CPPDEFINES=['MONO_GLUE_ENABLED']) +if env_mono['tools'] or env_mono['target'] != 'release': + env_mono.Append(CPPDEFINES=['GD_MONO_HOT_RELOAD']) + # Configure TLS checks import tls_configure diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 02220ab52f2..0b21ba3347b 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -607,7 +607,7 @@ struct CSharpScriptDepSort { void CSharpLanguage::reload_all_scripts() { -#ifdef DEBUG_ENABLED +#ifdef GD_MONO_HOT_RELOAD if (is_assembly_reloading_needed()) { reload_assemblies(false); } @@ -618,15 +618,20 @@ void CSharpLanguage::reload_tool_script(const Ref