conan.tools.android¶
android_abi()¶
- android_abi(conanfile, context='host')¶
Returns Android-NDK ABI
- 參數:
conanfile – ConanFile instance
context – either 「host」, 「build」 or 「target」
- 回傳:
Android-NDK ABI
This function might not be necessary when using Conan built-in integrations, as they already manage it, but can be useful if developing your own build system integration.
android_abi()
function returns the Android standard ABI name based on Conan settings.arch
value, something like:
def android_abi(conanfile, context="host"):
...
return {
"armv5el": "armeabi",
"armv5hf": "armeabi",
"armv5": "armeabi",
"armv6": "armeabi-v6",
"armv7": "armeabi-v7a",
"armv7hf": "armeabi-v7a",
"armv8": "arm64-v8a",
}.get(conanfile.settings.arch)
As it can be seen, the default is the 「host」 ABI, but it is possible to select also the 「build」 or 「target」 ones if necessary.
from conan.tools.android import android_abi
class Pkg(ConanFile):
def generate(self)
abi = android_abi(self)