Skip to content

Commit 4173760

Browse files
committed
Merge pull request godotengine#122186 from syntaxerror247/fix-editor-build
Fix building Android Editor with separate arches
2 parents b2ac089 + fa03d6d commit 4173760

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

platform/android/java/build.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ ext {
4242
rootDir = "../../.."
4343
binDir = "$rootDir/bin/"
4444
androidEditorBuildsDir = "$binDir/android_editor_builds/"
45+
46+
// Used by the editor module to set abiFilters.
47+
detectedAbis = []
4548
}
4649

4750
def getSconsTaskName(String flavor, String buildType, String abi) {
@@ -120,9 +123,18 @@ def generateBuildTasks(String flavor = "template", String edition = "standard",
120123
boolean excludeSconsBuildTasks = excludeSconsBuildTasks()
121124
boolean isTemplate = flavor == "template"
122125
String libsDir = isTemplate ? "lib/libs/" : "lib/libs/tools/"
126+
def validAbis = ["arm64-v8a", "armeabi-v7a", "x86_64", "x86"]
123127
for (String target : supportedFlavorsBuildTypes[flavor]) {
124128
File targetLibs = new File(libsDir + target)
125129

130+
if (targetLibs != null && targetLibs.isDirectory()) {
131+
targetLibs.listFiles()?.each { abiDir ->
132+
if (abiDir.isDirectory() && validAbis.contains(abiDir.name) && abiDir.listFiles()?.length > 0) {
133+
detectedAbis.add(abiDir.name)
134+
}
135+
}
136+
}
137+
126138
String targetSuffix = target
127139

128140
if (!excludeSconsBuildTasks || (targetLibs != null

platform/android/java/editor/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ android {
166166
android {
167167
dimension "android_distribution"
168168
missingDimensionStrategy 'products', 'editor'
169+
ndk {
170+
if (!detectedAbis.isEmpty()) {
171+
abiFilters += detectedAbis
172+
}
173+
}
169174
}
170175
horizonos {
171176
dimension "android_distribution"

0 commit comments

Comments
 (0)