From 3ab1b7511793cee9ef3b9234e4efad89306fe835 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Thu, 3 Oct 2024 14:54:40 +0300 Subject: [PATCH] [GDExtension] Improve error messages during export. --- editor/export/editor_export_platform_pc.cpp | 6 ++++++ editor/plugins/gdextension_export_plugin.h | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/editor/export/editor_export_platform_pc.cpp b/editor/export/editor_export_platform_pc.cpp index 31a5b60d772..52f7a0cee8e 100644 --- a/editor/export/editor_export_platform_pc.cpp +++ b/editor/export/editor_export_platform_pc.cpp @@ -222,9 +222,15 @@ Error EditorExportPlatformPC::export_project_data(const Ref err = da->make_dir_recursive(target_path); if (err == OK) { err = da->copy_dir(src_path, target_path, -1, true); + if (err != OK) { + add_message(EXPORT_MESSAGE_ERROR, TTR("GDExtension"), TTR(vformat("Failed to copy shared object \"%s\".", src_path))); + } } } else { err = da->copy(src_path, target_path); + if (err != OK) { + add_message(EXPORT_MESSAGE_ERROR, TTR("GDExtension"), TTR(vformat("Failed to copy shared object \"%s\".", src_path))); + } if (err == OK) { err = sign_shared_object(p_preset, p_debug, target_path); } diff --git a/editor/plugins/gdextension_export_plugin.h b/editor/plugins/gdextension_export_plugin.h index 0de6b7b611b..ad6b5342355 100644 --- a/editor/plugins/gdextension_export_plugin.h +++ b/editor/plugins/gdextension_export_plugin.h @@ -127,7 +127,10 @@ void GDExtensionExportPlugin::_export_file(const String &p_path, const String &p for (const String &E : p_features) { features_vector.append(E); } - ERR_FAIL_MSG(vformat("No suitable library found for GDExtension: %s. Possible feature flags for your platform: %s", p_path, String(", ").join(features_vector))); + if (get_export_platform().is_valid()) { + get_export_platform()->add_message(EditorExportPlatform::EXPORT_MESSAGE_WARNING, TTR("GDExtension"), vformat(TTR("No suitable library found for GDExtension: \"%s\". Possible feature flags for your platform: %s"), p_path, String(", ").join(features_vector))); + } + return; } Vector dependencies_shared_objects = GDExtensionLibraryLoader::find_extension_dependencies(p_path, config, [p_features](String p_feature) { return p_features.has(p_feature); });