Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Editor] Fix GDExtension GNU/Linux export. #61352

Merged
merged 2 commits into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions editor/plugins/gdextension_export_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,17 @@ void GDExtensionExportPlugin::_export_file(const String &p_path, const String &p
config.instantiate();

Error err = config->load(p_path);
ERR_FAIL_COND_MSG(err, "Failed to load GDExtension file: " + p_path);

if (err != OK) {
return;
}

if (!config->has_section_key("configuration", "entry_symbol")) {
return;
}
ERR_FAIL_COND_MSG(!config->has_section_key("configuration", "entry_symbol"), "Failed to export GDExtension file, missing entry symbol: " + p_path);

String entry_symbol = config->get_value("configuration", "entry_symbol");

List<String> libraries;

config->get_section_keys("libraries", &libraries);

bool could_export = false;
for (const String &E : libraries) {
Vector<String> tags = E.split(".");
bool all_tags_met = true;
Expand Down Expand Up @@ -101,13 +97,23 @@ void GDExtensionExportPlugin::_export_file(const String &p_path, const String &p
String linker_flags = "-Wl,-U,_" + entry_symbol;
add_ios_linker_flags(linker_flags);
}
could_export = true;
break;
}
}
if (!could_export) {
Vector<String> tags;
for (const String &E : p_features) {
tags.append(E);
}
ERR_FAIL_MSG(vformat("Couldn't export extension: %s. No suitable library found for export flags: %s", p_path, String(", ").join(tags)));
}

List<String> dependencies;
if (config->has_section("dependencies")) {
config->get_section_keys("dependencies", &dependencies);
}

config->get_section_keys("dependencies", &dependencies);
for (const String &E : libraries) {
Vector<String> tags = E.split(".");
bool all_tags_met = true;
Expand Down
2 changes: 1 addition & 1 deletion platform/linuxbsd/export/export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void register_linuxbsd_exporter() {
platform->set_name("Linux/X11");
platform->set_extension("x86_32");
platform->set_extension("x86_64", "binary_format/64_bits");
platform->set_os_name("LinuxBSD");
platform->set_os_name("Linux");
platform->set_chmod_flags(0755);

EditorExport::get_singleton()->add_export_platform(platform);
Expand Down