Skip to content

Commit 8f54fc3

Browse files
authored
added android-ndk as tool-requires (#3873)
1 parent efc40f3 commit 8f54fc3

File tree

1 file changed

+24
-0
lines changed
  • examples/cross_build/android

1 file changed

+24
-0
lines changed

examples/cross_build/android/ndk.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,30 @@ Both the library and the ``test_package`` executable are built for Android, so w
8181
Unless you have access to a `root` Android device, running the test application or using the built library is not possible
8282
directly so it is more common to build an Android application that uses the ``hello`` library.
8383

84+
It is also possible to use the ``android-ndk`` from a Conan ``tool-requires``.
85+
There is already a Conan package in ConanCenter containing the AndroidNDK, so writing a profile like:
86+
87+
.. code-block:: text
88+
89+
90+
[settings]
91+
os=Android
92+
os.api_level=21
93+
arch=armv8
94+
compiler=clang
95+
compiler.version=18
96+
compiler.libcxx=c++_static
97+
compiler.cppstd=14
98+
build_type=Release
99+
100+
# You might need Ninja conf and tool-requires in Windows too
101+
[tool_requires]
102+
android-ndk/[*]
103+
104+
And this will download automatically the latest android-ndk from ConanCenter and inject and apply it automatically to
105+
build the package. Note that to use packages from ConanCenter in production the :ref:`following approach is recommended<devops_consuming_conan_center>`
106+
107+
84108
.. seealso::
85109

86110
- Check the example :ref:`Integrating Conan in Android Studio<examples_cross_build_android_studio>` to know how to use your

0 commit comments

Comments
 (0)