Skip to content

Commit d54b619

Browse files
committed
Simplify Gradle code for ABI filtering.
1 parent 91e1c2c commit d54b619

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

android_build_files/android_abis.gradle

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ android {
2323
ndk {
2424
// Default list of ABIs available in up-to-date NDK.
2525
abiFilters "x86", "armeabi-v7a", "arm64-v8a", "x86_64"
26+
27+
if (System.getenv('NDK_ROOT').contains('r16b') ||
28+
System.getenv('NDK_ROOT').contains('r11c')) {
29+
// Deprecated ABIs are added to the list when building using older NDKs only.
30+
// Rather than an exhaustive list, we only support r11c and r16b.
31+
abiFilters.add("armeabi")
32+
abiFilters.add("mips")
33+
abiFilters.add("mips64")
34+
if (System.getenv('NDK_ROOT').contains('r11c')) {
35+
abiFilters.add("armeabi-v7a-hard") // Removed after r11c.
36+
}
37+
}
2638
}
2739
}
2840
}
2941

30-
if (System.getenv('NDK_ROOT')) {
31-
if (System.getenv('NDK_ROOT').contains('r16b') || System.getenv('NDK_ROOT').contains('r11c')) {
32-
// Deprecated ABIs are added to the list when building using older NDKs only.
33-
// Rather than an exhaustive list, we only support r11c and r16b.
34-
android.defaultConfig.ndk.abiFilters.add("armeabi")
35-
android.defaultConfig.ndk.abiFilters.add("mips")
36-
android.defaultConfig.ndk.abiFilters.add("mips64")
37-
if (System.getenv('NDK_ROOT').contains('r11c')) {
38-
android.defaultConfig.ndk.abiFilters.add("armeabi-v7a-hard") // Removed after r11c.
39-
}
40-
}
41-
}

0 commit comments

Comments
 (0)