mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Fix GDExtensions library export when multiple architectures are set.
(cherry picked from commit c2d678a924)
This commit is contained in:
parent
559d09c140
commit
7a3f8a83da
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);
|
||||
|
||||
|
|
@ -118,5 +144,6 @@ void GDExtensionExportPlugin::_export_file(const String &p_path, const String &p
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // GDEXTENSION_EXPORT_PLUGIN_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue