Validate supported architectures when exporting to Android

(cherry picked from commit 7fcd13575e)
This commit is contained in:
SkyJJ 2020-03-31 09:11:23 +02:00 committed by Rémi Verschelde
parent 373db27788
commit 96e381ac03
1 changed files with 9 additions and 0 deletions

View File

@ -2234,6 +2234,7 @@ public:
ImageLoader::load_image(path, launcher_adaptive_icon_background_image); ImageLoader::load_image(path, launcher_adaptive_icon_background_image);
} }
Vector<String> invalid_abis(enabled_abis);
while (ret == UNZ_OK) { while (ret == UNZ_OK) {
//get filename //get filename
@ -2279,6 +2280,7 @@ public:
bool enabled = false; bool enabled = false;
for (int i = 0; i < enabled_abis.size(); ++i) { for (int i = 0; i < enabled_abis.size(); ++i) {
if (file.begins_with("lib/" + enabled_abis[i] + "/")) { if (file.begins_with("lib/" + enabled_abis[i] + "/")) {
invalid_abis.erase(enabled_abis[i]);
enabled = true; enabled = true;
break; break;
} }
@ -2318,6 +2320,13 @@ public:
ret = unzGoToNextFile(pkg); ret = unzGoToNextFile(pkg);
} }
if (!invalid_abis.empty()) {
String unsupported_arch = String(", ").join(invalid_abis);
EditorNode::add_io_error("Missing libraries in the export template for the selected architectures: " + unsupported_arch + ".\n" +
"Please build a template with all required libraries, or uncheck the missing architectures in the export preset.");
CLEANUP_AND_RETURN(ERR_FILE_NOT_FOUND);
}
if (ep.step("Adding files...", 1)) { if (ep.step("Adding files...", 1)) {
CLEANUP_AND_RETURN(ERR_SKIP); CLEANUP_AND_RETURN(ERR_SKIP);
} }