Skip to content

Commit

Permalink
Mono: Don't compare API hashes on release builds
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
neikeq committed Sep 27, 2019
1 parent edf9055 commit 1509890
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/mono/editor/bindings_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion modules/mono/editor/bindings_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
3 changes: 2 additions & 1 deletion modules/mono/mono_gd/gd_mono.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
Expand All @@ -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
}

Expand Down
4 changes: 3 additions & 1 deletion modules/mono/mono_gd/gd_mono.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ class GDMono {
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);
Expand All @@ -162,7 +163,8 @@ class GDMono {
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);
Expand Down

0 comments on commit 1509890

Please sign in to comment.