官术网_书友最值得收藏!

Switching NDK toolchains

A toolchain is a set of tools that are used to build your project. A toolchain usually consists of a compiler, an assembler, and a linker. Android NDK comes with different toolchains—GCC and Clang—of different versions. It has a convenient and simple way to switch between them.

Getting ready

Look through the list of the available toolchains before proceeding. You can find all the available toolchains in the $(NDK_ROOT)/toolchains/ folder.

How to do it...

The parameter NDK_TOOLCHAIN_VERSION in Application.mk corresponds to one of the available toolchains. In NDK r9b, you can switch between three GCC versions—4.6, and 4.7, which are marked as deprecated and will be removed from the next NDK releases, and 4.8. And two Clang versions—Clang3.2, which is also marked as deprecated, and Clang3.3. The default toolchain in the NDK r9b is still GCC 4.6.

Starting from the NDK r8e, you can just specify clang as the value of NDK_TOOLCHAIN_VERSION. This option will select the most recent version of the available Clang toolchain.

There's more...

The toolchains are discovered by the $(NDK_ROOT)/build/core/init.mk script, so you can define your own toolchain in a folder named <ABI>-<ToolchainName> and use it in Application.mk.

主站蜘蛛池模板: 岳普湖县| 新源县| 罗平县| 眉山市| 和龙市| 来凤县| 探索| 曲靖市| 布尔津县| 丰城市| 青岛市| 嘉禾县| 新宾| 昭苏县| 古蔺县| 潞西市| 祥云县| 策勒县| 柳河县| 沙河市| 句容市| 交城县| 芮城县| 于田县| 临武县| 余干县| 徐水县| 夏津县| 阿尔山市| 隆回县| 鸡东县| 仁怀市| 仁寿县| 安泽县| 德保县| 伊宁市| 岫岩| 镇江市| 洛扎县| 白城市| 绥滨县|