Fix GDExtensions library export when multiple architectures are set.
This commit is contained in:
parent
8208060c21
commit
c2d678a924
1 changed files with 80 additions and 53 deletions
|
@ -54,9 +54,35 @@ void GDExtensionExportPlugin::_export_file(const String &p_path, const String &p
|
|||
|
||||
String entry_symbol = config->get_value("configuration", "entry_symbol");
|
||||
|
||||
HashSet<String> all_archs;
|
||||
all_archs.insert("x86_32");
|
||||
all_archs.insert("x86_64");
|
||||
all_archs.insert("arm32");
|
||||
all_archs.insert("arm64");
|
||||
all_archs.insert("rv64");
|
||||
all_archs.insert("ppc32");
|
||||
all_archs.insert("ppc64");
|
||||
all_archs.insert("wasm32");
|
||||
all_archs.insert("universal");
|
||||
|
||||
HashSet<String> archs;
|
||||
HashSet<String> features_wo_arch;
|
||||
for (const String &tag : p_features) {
|
||||
if (all_archs.has(tag)) {
|
||||
archs.insert(tag);
|
||||
} else {
|
||||
features_wo_arch.insert(tag);
|
||||
}
|
||||
}
|
||||
|
||||
if (archs.is_empty()) {
|
||||
archs.insert("unknown_arch"); // Not archs specified, still try to match.
|
||||
}
|
||||
|
||||
for (const String &arch_tag : archs) {
|
||||
PackedStringArray tags;
|
||||
String library_path = GDExtension::find_extension_library(
|
||||
p_path, config, [p_features](String p_feature) { return p_features.has(p_feature); }, &tags);
|
||||
p_path, config, [features_wo_arch, arch_tag](String p_feature) { return features_wo_arch.has(p_feature) || (p_feature == arch_tag); }, &tags);
|
||||
if (!library_path.is_empty()) {
|
||||
add_shared_object(library_path, tags);
|
||||
|
||||
|
@ -117,6 +143,7 @@ void GDExtensionExportPlugin::_export_file(const String &p_path, const String &p
|
|||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // GDEXTENSION_EXPORT_PLUGIN_H
|
||||
|
|
Loading…
Reference in a new issue