summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Android-Common.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Android: Fix support for CMAKE_SYSROOT without CMAKE_SYSROOT_COMPILEBrad King2017-08-031-3/+9
| | | | | | | | | 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
* Android: Always add standard include directories lastBrad King2017-07-131-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Android: Fix include path for unified headersBrad King2017-06-221-2/+6
| | | | | | | | | 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
* Android: Add support for unified headersBrad King2017-06-121-0/+3
| | | | | | | | 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
* Android: Do not pass sysroot include for standalone toolchainBrad King2017-06-091-2/+7
| | | | | | | | | | 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
* Android: Pass sysroot include directory explicitlyBrad King2017-01-201-0/+9
| | | | | | | | | | | | | | | | | 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
* Android: Add missing link flags for device executablesBrad King2016-10-211-0/+4
| | | | | | | | | 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
* Simplify CMake per-source license noticesBrad King2016-09-271-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Android: Select the STL type for NDK buildsBrad King2016-08-231-0/+106
| | | | | | | 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.
* Android: Populate compiler flags for current ABIBrad King2016-08-231-0/+31
| | | | | Initialize the CMAKE_{C,CXX}_FLAGS{,_<CONFIG>} cache entries with flags for each ABI as specified by NDK toolchain `setup.mk` files.
* Android: Add placeholders for platform-specific compiler settingsBrad King2016-08-121-0/+21
Add infrastructure modules to be loaded for Clang and GNU compilers when targeting Android platforms.