You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/cross_build/android/ndk.rst
+24Lines changed: 24 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -81,6 +81,30 @@ Both the library and the ``test_package`` executable are built for Android, so w
81
81
Unless you have access to a `root` Android device, running the test application or using the built library is not possible
82
82
directly so it is more common to build an Android application that uses the ``hello`` library.
83
83
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
+
84
108
.. seealso::
85
109
86
110
- Check the example :ref:`Integrating Conan in Android Studio<examples_cross_build_android_studio>` to know how to use your
0 commit comments