summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-07-26 16:48:35 (GMT)
committerBrad King <brad.king@kitware.com>2019-07-26 18:17:07 (GMT)
commit97bca2f9fab58fcf5bbcb29e1e7e86e37b5cc1e0 (patch)
tree048fee25cd8797b3527994c504c5b8ce50e2ede2 /Help
parent19f36c5fb2497703e4f071b3a9424a8d121ccef9 (diff)
downloadCMake-97bca2f9fab58fcf5bbcb29e1e7e86e37b5cc1e0.zip
CMake-97bca2f9fab58fcf5bbcb29e1e7e86e37b5cc1e0.tar.gz
CMake-97bca2f9fab58fcf5bbcb29e1e7e86e37b5cc1e0.tar.bz2
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
Diffstat (limited to 'Help')
-rw-r--r--Help/manual/cmake-toolchains.7.rst6
-rw-r--r--Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION.rst6
2 files changed, 9 insertions, 3 deletions
diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst
index 7435d9a..f233d08 100644
--- a/Help/manual/cmake-toolchains.7.rst
+++ b/Help/manual/cmake-toolchains.7.rst
@@ -399,8 +399,10 @@ Configure use of an Android NDK with the following variables:
be false unless using a NDK that does not provide unified headers.
:variable:`CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION`
- Set to the version of the NDK toolchain to be selected as the compiler.
- If not specified, the default will be the latest available GCC toolchain.
+ On NDK r19 or above, this variable must be unset or set to ``clang``.
+ On NDK r18 or below, set this to the version of the NDK toolchain to
+ be selected as the compiler. If not specified, the default will be
+ the latest available GCC toolchain.
:variable:`CMAKE_ANDROID_STL_TYPE`
Set to specify which C++ standard library to use. If not specified,
diff --git a/Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION.rst b/Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION.rst
index 5ae55d1..22808e3 100644
--- a/Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION.rst
+++ b/Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION.rst
@@ -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