浏览代码

Merge pull request #32401 from neikeq/Kisaama!

Mono: Don't compare API hashes on release builds
Ignacio Roldán Etcheverry 6 年之前
父节点
当前提交
763a4d8402

+ 1 - 1
modules/mono/editor/bindings_generator.cpp

@@ -30,7 +30,7 @@
 
 
 #include "bindings_generator.h"
 #include "bindings_generator.h"
 
 
-#ifdef DEBUG_METHODS_ENABLED
+#if defined(DEBUG_METHODS_ENABLED) && defined(TOOLS_ENABLED)
 
 
 #include "core/engine.h"
 #include "core/engine.h"
 #include "core/global_constants.h"
 #include "core/global_constants.h"

+ 1 - 1
modules/mono/editor/bindings_generator.h

@@ -36,7 +36,7 @@
 #include "editor/doc/doc_data.h"
 #include "editor/doc/doc_data.h"
 #include "editor/editor_help.h"
 #include "editor/editor_help.h"
 
 
-#ifdef DEBUG_METHODS_ENABLED
+#if defined(DEBUG_METHODS_ENABLED) && defined(TOOLS_ENABLED)
 
 
 #include "core/ustring.h"
 #include "core/ustring.h"
 
 

+ 2 - 1
modules/mono/mono_gd/gd_mono.cpp

@@ -430,8 +430,8 @@ void GDMono::_register_internal_calls() {
 }
 }
 
 
 void GDMono::_initialize_and_check_api_hashes() {
 void GDMono::_initialize_and_check_api_hashes() {
-
 #ifdef MONO_GLUE_ENABLED
 #ifdef MONO_GLUE_ENABLED
+#ifdef DEBUG_METHODS_ENABLED
 	if (get_api_core_hash() != GodotSharpBindings::get_core_api_hash()) {
 	if (get_api_core_hash() != GodotSharpBindings::get_core_api_hash()) {
 		ERR_PRINT("Mono: Core API hash mismatch.");
 		ERR_PRINT("Mono: Core API hash mismatch.");
 	}
 	}
@@ -441,6 +441,7 @@ void GDMono::_initialize_and_check_api_hashes() {
 		ERR_PRINT("Mono: Editor API hash mismatch.");
 		ERR_PRINT("Mono: Editor API hash mismatch.");
 	}
 	}
 #endif // TOOLS_ENABLED
 #endif // TOOLS_ENABLED
+#endif // DEBUG_METHODS_ENABLED
 #endif // MONO_GLUE_ENABLED
 #endif // MONO_GLUE_ENABLED
 }
 }
 
 

+ 3 - 1
modules/mono/mono_gd/gd_mono.h

@@ -151,6 +151,7 @@ protected:
 	static GDMono *singleton;
 	static GDMono *singleton;
 
 
 public:
 public:
+#ifdef DEBUG_METHODS_ENABLED
 	uint64_t get_api_core_hash() {
 	uint64_t get_api_core_hash() {
 		if (api_core_hash == 0)
 		if (api_core_hash == 0)
 			api_core_hash = ClassDB::get_api_hash(ClassDB::API_CORE);
 			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);
 			api_editor_hash = ClassDB::get_api_hash(ClassDB::API_EDITOR);
 		return api_editor_hash;
 		return api_editor_hash;
 	}
 	}
-#endif
+#endif // TOOLS_ENABLED
+#endif // DEBUG_METHODS_ENABLED
 
 
 #ifdef TOOLS_ENABLED
 #ifdef TOOLS_ENABLED
 	bool copy_prebuilt_api_assembly(APIAssembly::Type p_api_type, const String &p_config);
 	bool copy_prebuilt_api_assembly(APIAssembly::Type p_api_type, const String &p_config);