android: add support for x86_64 images (#31725)

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
Mukilan Thiyagarajan 2024-03-18 15:14:10 +05:30 committed by GitHub
parent b2f2ae61db
commit 4bca55e27a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 57 additions and 5 deletions

View file

@ -27,7 +27,8 @@ ext.getRustTarget = { String arch ->
switch (arch.toLowerCase()) {
case 'armv7' : return 'armv7-linux-androideabi'
case 'arm64' : return 'aarch64-linux-android'
case 'x86' : return 'i686-linux-android'
case 'x86': return 'i686-linux-android'
case 'x64': return 'x86_64-linux-android'
default: throw new GradleException("Invalid target architecture " + arch)
}
}
@ -36,7 +37,8 @@ ext.getNDKAbi = { String arch ->
switch (arch.toLowerCase()) {
case 'armv7' : return 'armeabi-v7a'
case 'arm64' : return 'arm64-v8a'
case 'x86' : return 'x86'
case 'x86': return 'x86'
case 'x64': return 'x86_64'
default: throw new GradleException("Invalid target architecture " + arch)
}
}

View file

@ -2,4 +2,7 @@ NDK_TOOLCHAIN_VERSION := clang
APP_MODULES := c++_shared servojni
APP_PLATFORM := android-30
APP_STL := c++_shared
APP_ABI := armeabi-v7a x86
APP_ABI := armeabi-v7a x86 x86_64
ifeq ($(NDK_DEBUG),1)
APP_STRIP_MODE := none
endif

View file

@ -97,6 +97,18 @@ android {
abiFilters getNDKAbi('x86')
}
}
x64Debug {
initWith(debug)
ndk {
abiFilters getNDKAbi('x64')
}
}
x64Release {
initWith(release)
ndk {
abiFilters getNDKAbi('x64')
}
}
}
// Ignore default 'debug' and 'release' build types

View file

@ -76,6 +76,12 @@ android {
x86Release {
initWith(release)
}
x64Debug {
initWith(debug)
}
x64Release {
initWith(release)
}
}
sourceSets {
@ -99,6 +105,12 @@ android {
x86Release {
jniLibs.srcDirs = [getJniLibsPath(false, 'x86')]
}
x64Debug {
jniLibs.srcDirs = [getJniLibsPath(true, 'x64')]
}
x64Release {
jniLibs.srcDirs = [getJniLibsPath(false, 'x64')]
}
}
// Ignore default 'debug' and 'release' build types
@ -183,7 +195,7 @@ dependencies {
]
// Iterate all build types and dependencies
// For each dependency call the proper implementation command and set the correct dependency path
def list = ['armv7', 'arm64', 'x86']
def list = ['armv7', 'arm64', 'x86', 'x64']
for (arch in list) {
for (debug in [true, false]) {
String basePath = getTargetDir(debug, arch) + "/build"