mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 12:49:36 -06:00
Android: Use unified toolchain in NDK r19+
The NDK build system now uses only a single toolchain in
<ndk>/toolchains/llvm/prebuilt/<host>
Its compilers are always `bin/{clang,clang++}` and its binutils are
always `bin/<triple>-*`. It is a standalone toolchain:
* The Anrdoid API level is specified at the end of `--target=`.
* The standard library may be specified via `-stdlib=`.
* No need to pass system includes or libraries explicitly.
* No need to pass `--sysroot` or `-gcc-toolchain`.
Teach CMake to recognize NDK versions that have a unified
toolchain with its own sysroot and use the above approach.
Fixes: #18739
This commit is contained in:
@@ -3,7 +3,11 @@ CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION
|
||||
|
||||
When :ref:`Cross Compiling for Android with the NDK`, this variable
|
||||
may be set to specify the version of the toolchain to be used
|
||||
as the compiler. The variable must be set to one of these forms:
|
||||
as the compiler.
|
||||
|
||||
On NDK r19 or above, this variable must be unset or set to ``clang``.
|
||||
|
||||
On NDK r18 or below, this variable must be set to one of these forms:
|
||||
|
||||
* ``<major>.<minor>``: GCC of specified version
|
||||
* ``clang<major>.<minor>``: Clang of specified version
|
||||
|
||||
Reference in New Issue
Block a user