

The following console print comes from the compilation of example 1. We will see what is actually done by ndk-build. The ndk-build WorkflowĪctually, when we use ndk-build, if we enable the debug option V=1 as follows: ndk-build V= 1 But it is still a good reference to have anyways. Therefore, it might be hard to follow the official document. However, that document is short of details, and there is no example to demonstrate the usage.

The Android NDK official document contain a chapter “STANDALONE-TOOLCHAIN”, which gives useful information about the standalone toolchain. Use customized toolchain for your projects.The source code of all examples can be found here. Therefore, in this part, I will briefly cover the usage of the standalone toolchain, and give a few code examples. Using standalone toolchain makes more sense in this case, and it allows you to keep your original makefile or reuse most of the original makefile. In that case, you may not want to convert everything to Android.mk and Application.mk. For example, if you already have a C/C++ project which might be quite complex and has a complicated makefile.
Android ndk build for x86 how to#
In the previous part ( part 1), we have introduced how to use ndk-build to build Android native projects, and we also covered several advanced techniques to manage and customize the build script for bigger projects.Īlthough ndk-build is probably more than enough for most of the Android native projects, there might still be demand for the standalone toolchain in some cases. This is the part 2 of “Mastering NDK” article.
