Skip to content

Commit

Permalink
Merge pull request godotengine#30710 from neikeq/issue-30526
Browse files Browse the repository at this point in the history
Fix mono module build errors for release templates
  • Loading branch information
neikeq authored Jul 20, 2019
2 parents 60efd67 + ec679df commit 4379395
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
4 changes: 4 additions & 0 deletions modules/mono/class_db_api_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

#include "class_db_api_json.h"

#ifdef DEBUG_METHODS_ENABLED

#include "core/io/json.h"
#include "core/os/file_access.h"
#include "core/project_settings.h"
Expand Down Expand Up @@ -240,3 +242,5 @@ void class_db_api_to_json(const String &p_output_file, ClassDB::APIType p_api) {

print_line(String() + "ClassDB API JSON written to: " + ProjectSettings::get_singleton()->globalize_path(p_output_file));
}

#endif // DEBUG_METHODS_ENABLED
7 changes: 7 additions & 0 deletions modules/mono/class_db_api_json.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,16 @@
#ifndef CLASS_DB_API_JSON_H
#define CLASS_DB_API_JSON_H

// 'core/method_bind.h' defines DEBUG_METHODS_ENABLED, but it looks like we
// cannot include it here. That's why we include it through 'core/class_db.h'.
#include "core/class_db.h"

#ifdef DEBUG_METHODS_ENABLED

#include "core/ustring.h"

void class_db_api_to_json(const String &p_output_file, ClassDB::APIType p_api);

#endif // DEBUG_METHODS_ENABLED

#endif // CLASS_DB_API_JSON_H
7 changes: 5 additions & 2 deletions modules/mono/mono_gd/gd_mono.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,7 @@ bool GDMono::_try_load_api_assemblies() {
void GDMono::_load_api_assemblies() {

if (!_try_load_api_assemblies()) {
#ifdef TOOLS_ENABLED
// The API assemblies are out of sync. Fine, try one more time, but this time
// update them from the prebuilt assemblies directory before trying to load them.

Expand Down Expand Up @@ -752,18 +753,20 @@ void GDMono::_load_api_assemblies() {
ERR_PRINT("The loaded assembly '" CORE_API_ASSEMBLY_NAME "' is in sync, but the cache update failed");
}

#ifdef TOOLS_ENABLED
if (editor_api_assembly_out_of_sync) {
ERR_PRINT("The assembly '" EDITOR_API_ASSEMBLY_NAME "' is out of sync");
}
#endif

CRASH_NOW();
} else {
ERR_EXPLAIN("Failed to load one of the API assemblies");
CRASH_NOW();
}
}
#else
ERR_EXPLAIN("Failed to load one of the API assemblies");
CRASH_NOW();
#endif
}
}

Expand Down

0 comments on commit 4379395

Please sign in to comment.