summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgnacio Etcheverry <ignalfonsore@gmail.com>2019-09-28 01:07:57 +0200
committerIgnacio Etcheverry <ignalfonsore@gmail.com>2019-09-28 01:07:57 +0200
commit1509890dbcca743cd306f55403be7a1729904652 (patch)
tree1dfec8b016df14fe95519e97afcefa60807f6994
parentedf9055b7f3fb16f9b927d09bc84be31c1076ce7 (diff)
Mono: Don't compare API hashes on release builds
API hashes cannot be calculated on release builds, as bindings information is lacking. Therefore, we should not be comparing it with the generated glue hash as they will never match.
-rw-r--r--modules/mono/editor/bindings_generator.cpp2
-rw-r--r--modules/mono/editor/bindings_generator.h2
-rw-r--r--modules/mono/mono_gd/gd_mono.cpp3
-rw-r--r--modules/mono/mono_gd/gd_mono.h4
4 files changed, 7 insertions, 4 deletions
diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp
index 28f098d323..28cab2ab61 100644
--- a/modules/mono/editor/bindings_generator.cpp
+++ b/modules/mono/editor/bindings_generator.cpp
@@ -30,7 +30,7 @@
#include "bindings_generator.h"
-#ifdef DEBUG_METHODS_ENABLED
+#if defined(DEBUG_METHODS_ENABLED) && defined(TOOLS_ENABLED)
#include "core/engine.h"
#include "core/global_constants.h"
diff --git a/modules/mono/editor/bindings_generator.h b/modules/mono/editor/bindings_generator.h
index 26718f1d11..8f3676940b 100644
--- a/modules/mono/editor/bindings_generator.h
+++ b/modules/mono/editor/bindings_generator.h
@@ -36,7 +36,7 @@
#include "editor/doc/doc_data.h"
#include "editor/editor_help.h"
-#ifdef DEBUG_METHODS_ENABLED
+#if defined(DEBUG_METHODS_ENABLED) && defined(TOOLS_ENABLED)
#include "core/ustring.h"
diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp
index 915a01af7e..ae685a5cb8 100644
--- a/modules/mono/mono_gd/gd_mono.cpp
+++ b/modules/mono/mono_gd/gd_mono.cpp
@@ -427,8 +427,8 @@ void GDMono::_register_internal_calls() {
}
void GDMono::_initialize_and_check_api_hashes() {
-
#ifdef MONO_GLUE_ENABLED
+#ifdef DEBUG_METHODS_ENABLED
if (get_api_core_hash() != GodotSharpBindings::get_core_api_hash()) {
ERR_PRINT("Mono: Core API hash mismatch.");
}
@@ -438,6 +438,7 @@ void GDMono::_initialize_and_check_api_hashes() {
ERR_PRINT("Mono: Editor API hash mismatch.");
}
#endif // TOOLS_ENABLED
+#endif // DEBUG_METHODS_ENABLED
#endif // MONO_GLUE_ENABLED
}
diff --git a/modules/mono/mono_gd/gd_mono.h b/modules/mono/mono_gd/gd_mono.h
index 4f7d3791f7..343d68bc2d 100644
--- a/modules/mono/mono_gd/gd_mono.h
+++ b/modules/mono/mono_gd/gd_mono.h
@@ -151,6 +151,7 @@ protected:
static GDMono *singleton;
public:
+#ifdef DEBUG_METHODS_ENABLED
uint64_t get_api_core_hash() {
if (api_core_hash == 0)
api_core_hash = ClassDB::get_api_hash(ClassDB::API_CORE);
@@ -162,7 +163,8 @@ public:
api_editor_hash = ClassDB::get_api_hash(ClassDB::API_EDITOR);
return api_editor_hash;
}
-#endif
+#endif // TOOLS_ENABLED
+#endif // DEBUG_METHODS_ENABLED
#ifdef TOOLS_ENABLED
bool copy_prebuilt_api_assembly(APIAssembly::Type p_api_type, const String &p_config);