summaryrefslogtreecommitdiffstats
path: root/platform/android/export/export_plugin.cpp
diff options
context:
space:
mode:
authorRaul Santos <raulsntos@gmail.com>2023-10-04 04:31:44 +0200
committerRaul Santos <raulsntos@gmail.com>2023-10-10 00:35:08 +0200
commitcea77d0b48523425b92c1d0fb1fcd53ced693456 (patch)
tree41eea3c72ef516cc311942eb002039421f66230c /platform/android/export/export_plugin.cpp
parent6b727ebdd298bdfad8b5c5ea78100bfb6a537d79 (diff)
downloadredot-engine-cea77d0b48523425b92c1d0fb1fcd53ced693456.tar.gz
C#: Add checks to Android export
- Add .NET 7.0 TFM when the platform is Anroid to the created csproj. - Prevent exporting to Android when the architecture is not supported.
Diffstat (limited to 'platform/android/export/export_plugin.cpp')
-rw-r--r--platform/android/export/export_plugin.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp
index aeaa7b9ce7..c3015ec260 100644
--- a/platform/android/export/export_plugin.cpp
+++ b/platform/android/export/export_plugin.cpp
@@ -2238,6 +2238,19 @@ bool EditorExportPlatformAndroid::has_valid_export_configuration(const Ref<Edito
#ifdef MODULE_MONO_ENABLED
// Android export is still a work in progress, keep a message as a warning.
err += TTR("Exporting to Android when using C#/.NET is experimental.") + "\n";
+
+ bool unsupported_arch = false;
+ Vector<ABI> enabled_abis = get_enabled_abis(p_preset);
+ for (ABI abi : enabled_abis) {
+ if (abi.arch != "arm64" && abi.arch != "x86_64") {
+ err += vformat(TTR("Android architecture %s not supported in C# projects."), abi.arch) + "\n";
+ unsupported_arch = true;
+ }
+ }
+ if (unsupported_arch) {
+ r_error = err;
+ return false;
+ }
#endif
// Look for export templates (first official, and if defined custom templates).