| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
For older NDKs we used `__android_stl_lib` to link these libraries, but
the `CMAKE_ANDROID_NDK_TOOLCHAIN_UNIFIED` code path does not use that.
Link the libraries the way the NDK toolchain file does:
https://android.googlesource.com/platform/ndk/+/43b2de34ef9e3a70573fe51a9e069f985a4be5b9/build/cmake/android.toolchain.cmake#368
|
|
|
|
|
|
|
|
|
| |
With the NDK's `android.toolchain.cmake`, the user can control whether
exceptions/rtti is enabled using `ANDROID_CPP_FEATURES`:
https://android.googlesource.com/platform/ndk/+/43b2de34ef9e3a70573fe51a9e069f985a4be5b9/build/cmake/android.toolchain.cmake#548
Add `CMAKE_ANDROID_RTTI` and `CMAKE_ANDROID_EXCEPTIONS` to support that.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
The triple applies to more than just header locations.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
NDK r18 drops GCC toolchains and some STL types. We need to choose a
clang toolchain by default when no gcc toolchains are available. Switch
the STL type default to `c++_static` when the old `gnustl_static`
default is not available.
Update the test suite to not run tests for STL types that do not exist.
Also do not expect the gcc toolchain `cpp` tool to be available because
r18 does not provide it. Also teach it to tolerate `gcc -dumpmachine`
output like `arm--linux-android` that differs from the toolchain prefix.
Fixes: #18301
|
|
|
|
|
|
|
|
|
| |
If `CMAKE_SYSROOT` is set by the user (e.g. via the toolchain file) then
we do not set `CMAKE_SYSROOT_COMPILE` to our default. Fix our
references to the sysroot's `/usr/include` directory to use
`CMAKE_SYSROOT_COMPILE` only if it is set and else `CMAKE_SYSROOT`.
Fixes: #17096
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The logic added in commit v3.6.0-rc1~30^2 (Add a variable to specify
language-wide system include directories, 2016-05-24) to use
`CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES` incorrectly filters them by
`CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES`. Rather than recognizing
this, commit v3.8.0-rc1~60^2 (Android: Pass sysroot include directory
explicitly, 2017-01-20) worked around the problem by incorrectly
removing `/usr/include` from `CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES`
so it worked in `CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES`.
By not filtering out `/usr/include` from user-specified include
directories, we allow the code
include_directories(${CMAKE_SYSROOT}/usr/include)
to place the include directory too early on the command line.
Fix support for standard include directories to not be filtered by
implicit include directories, and do not remove `/usr/include` from the
list of implicit include directories for Android builds. Add a test
case to verify that an explicit `/usr/include` is ignored in favor
of the standard directory at the end.
Fixes: #17059
|
|
|
|
|
|
|
|
|
| |
In commit v3.9.0-rc3~3^2 (Android: Add support for unified headers,
2017-06-12) we accidentally constructed the unified header include
directories from the linking sysroot. Construct them from the
compiling sysroot instead.
Fixes: #16584
|
|
|
|
|
|
|
|
| |
The unified headers are preferred as of NDK r15, so use them by default
if available and provide an option to use the deprecated headers.
Inspired-by: Florent Castelli <florent.castelli@gmail.com>
Fixes: #16584
|
|
|
|
|
|
|
|
|
|
| |
The change in commit v3.8.0-rc1~60^2 (Android: Pass sysroot include
directory explicitly, 2017-01-20) does not make sense when compiling
with a standalone toolchain which is tied to a single API version.
Drop the explicit include directory so that the compiler uses its
default system include order.
Fixes: #16954
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The NDK's `build/core/definitions.mk` file adds compiler flags:
-isystem $$(call host-path,$$(SYSROOT_INC)/usr/include)
This passes the system include directory explicitly even though it is
implied by `--sysroot=`. The explicit flag places the directory
earlier in the include path than the sysroot-default one would be.
Teach CMake to add this include directory at the end of the standard
include path for Android. Otherwise the toolchain's `include-fixed/`
directory may replace system headers with "fixed" copies that are not
from the same API version.
Closes: #16536
|
|
|
|
|
|
|
|
|
| |
See `${ndk}/build/core/default-build-commands.mk` for link flags the NDK
uses for executables. Add them to our default executable link flags.
Suppress `nocopyreloc` on `arm64-v8a` because it does not work with
some STL types.
Closes: #16380
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Per-source copyright/license notice headers that spell out copyright holder
names and years are hard to maintain and often out-of-date or plain wrong.
Precise contributor information is already maintained automatically by the
version control tool. Ultimately it is the receiver of a file who is
responsible for determining its licensing status, and per-source notices are
merely a convenience. Therefore it is simpler and more accurate for
each source to have a generic notice of the license name and references to
more detailed information on copyright holders and full license terms.
Our `Copyright.txt` file now contains a list of Contributors whose names
appeared source-level copyright notices. It also references version control
history for more precise information. Therefore we no longer need to spell
out the list of Contributors in each source file notice.
Replace CMake per-source copyright/license notice headers with a short
description of the license and links to `Copyright.txt` and online information
available from "https://cmake.org/licensing". The online URL also handles
cases of modules being copied out of our source into other projects, so we
can drop our notices about replacing links with full license text.
Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
of the replacements mechanically. Manually fix up shebang lines and trailing
newlines in a few files. Manually update the notices in a few files that the
script does not handle.
|
|
|
|
|
|
|
| |
Populate standard include directories and link libraries for the
platform. Select the STL corresponding to CMAKE_ANDROID_STL_TYPE and
matching the current ABI and toolchain to be used. Refer to the NDK
sources/cxx-stl/*/Android.mk files for the needed file locations.
|
|
|
|
|
| |
Initialize the CMAKE_{C,CXX}_FLAGS{,_<CONFIG>} cache entries with
flags for each ABI as specified by NDK toolchain `setup.mk` files.
|
|
Add infrastructure modules to be loaded for Clang and GNU compilers
when targeting Android platforms.
|