Skip to content

Commit

Permalink
android_abi() (conan-io#2975)
Browse files Browse the repository at this point in the history
* android_abi()

* Update reference/conanfile/tools/android.rst

---------

Co-authored-by: Carlos Zoido <[email protected]>
  • Loading branch information
memsharded and czoido authored Feb 16, 2023
1 parent a5ec99d commit 369e7f6
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions reference/conanfile/tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,4 @@ Contents:
tools/layout
tools/scm
tools/build
tools/android
46 changes: 46 additions & 0 deletions reference/conanfile/tools/android.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
.. _conan_tools_android:

conan.tools.android
===================

.. important::

Some of the features used in this section are still **under development**, while they are
recommended and usable and we will try not to break them in future releases, some breaking
changes might still happen if necessary to prepare for the *Conan 2.0 release*.


android_abi()
-------------

Available since: 1.59.0

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:

.. code-block:: python
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.

.. code-block:: python
from conan.tools.android import android_abi
class Pkg(ConanFile):
def generate(self)
abi = android_abi(self)

0 comments on commit 369e7f6

Please sign in to comment.