Skip to content

Commit

Permalink
Merge pull request #61352 from Faless/ext/linux_export
Browse files Browse the repository at this point in the history
[Editor] Fix GDExtension GNU/Linux export.
  • Loading branch information
akien-mga authored May 24, 2022
2 parents cc21892 + 9c2b5ae commit 360119f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
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

0 comments on commit 360119f

Please sign in to comment.