summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/Android
Commit message (Collapse)AuthorAgeFilesLines
* Tests: Update RunCMake.Android for NDK r22Brad King2021-03-031-2/+13
| | | | | Use `CMAKE_ANDROID_NDK_VERSION` to check for files expected based on the version of the NDK.
* Android: restructure android search pathsHaibo Huang2020-11-092-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Set CMAKE_FIND_ROOT_PATH unconditionally. Revise the implementation from commit a7f41a7ee4 (Android: Fix find_* search order within NDK for unified toolchains, 2020-10-13). In the old implementation, if people set CMAKE_FIND_ROOT_PATH, CMAKE_ANDROID_NDK won't be added to find root. And all paths added to CMAKE_SYSTEM_*_PATH below will be rerooted to the user specified root. 2. Add api level specific library path to CMAKE_SYSTEM_PREFIX_PATH. As the discussion in [1], some people want the paths added by UnixPaths.cmake. They install their libraries according to GNUInstallDirs [2]. As a result, we cannot clear CMAKE_SYSTEM_PREFIX_PATH. It includes /usr so no matter what we specify in CMAKE_SYSTEM_LIBRARY_PATH, /usr/lib/<arch> will be searched first. The author also pointed out a way to solve this issue [3]. In addition to other paths, CMake also searches <root>/<prefix> [4]. So we can add the API specific lib path to the beginning of CMAKE_SYSTEM_PREFIX_PATH, to have it searched first. [1] https://android-review.googlesource.com/c/platform/ndk/+/1486800 [2] https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html [3] https://github.com/android/ndk/issues/1179#issuecomment-613435081 [4] https://gitlab.kitware.com/cmake/cmake/-/blob/11425041f04fd0945480b8f9e9933d1549b93981/Source/cmSearchPath.cxx#L202
* Android: Fatal if ABI is not supported by NDKHaibo Huang2020-10-091-1/+1
|
* Visual Studio: Add Android supportKyle Edwards2020-06-248-9/+93
|
* Tests: Ensure that Android tests work for multi-config generatorsKyle Edwards2020-06-051-4/+27
|
* Tests: Append .exe suffix to objdump in Android test on WindowsKyle Edwards2020-06-051-1/+1
|
* Android: Use unified toolchain in NDK r19+Brad King2019-07-2610-12/+15
| | | | | | | | | | | | | | | | | | | 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
* Android: Update test to not require GCC compiler to exist in NDKBrad King2019-07-261-18/+19
|
* Android: Add support for NDK r18Brad King2018-08-282-6/+12
| | | | | | | | | | | | | | 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
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-014-81/+81
| | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Android: Add support for NDK r17Brad King2018-04-172-7/+9
| | | | | | | | | The `armeabi` ABI is no longer available, so we can no longer use it by default unconditionally. Instead detect all available ABIs and choose the oldest arm ABI that is available. Also update the test suite to account for the lack of `armeabi` support and pass as of Android NDK r17-beta2.
* Android: Suppress implicit -lstdc++ linker flagBrad King2018-04-033-0/+29
| | | | | | | | | | The chosen STL libraries are already linked explicitly so we shouldn't let the compiler add its implicit `-lstdc++` (the default) when invoking the linker. Fixes: #17863 NDK-Issue: https://github.com/android-ndk/ndk/issues/105 Inspired-by: Tom Hughes <tomtheengineer@gmail.com>
* Android: Always add standard include directories lastBrad King2017-07-134-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | 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: Add CMAKE_<LANG>_ANDROID_TOOLCHAIN_MACHINEBrad King2016-11-141-0/+17
| | | | | | | | Expose the binutils' machine name (typically used as a prefix on the tool names) publicly. This is expected to match the `gcc -dumpmachine` value. Suggested-by: Ruslan Baratov <ruslan_baratov@yahoo.com>
* Android: Add CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG variableBrad King2016-11-141-0/+8
| | | | | | | | | The NDK provides prebuilt toolchain files in directories named for the host architecture. The NDK build system calls this `HOST_TAG`. Expose the value publicly for use by clients that need to pass it to external tools. Suggested-by: Ruslan Baratov <ruslan_baratov@yahoo.com>
* Android: Always set CMAKE_ANDROID_NDK_TOOLCHAIN_VERSIONBrad King2016-11-141-1/+8
| | | | | | | | | When this variable is not set by the user or toolchain file, set it to the default selected. This will be useful for client code that needs to pass the value to an external tool that needs to find the same toolchain in the NDK. Leave it empty for a standalone toolchain. Suggested-by: Ruslan Baratov <ruslan_baratov@yahoo.com>
* Android: Fix support for armeabi with c++_staticBrad King2016-10-211-5/+0
| | | | | | | | Add missing "unwind" and "atomic" libraries needed for this combination. See `${ndk}/sources/cxx-stl/llvm-libc++/libs/armeabi/libc++.a` for the libraries the NDK uses. Issue: #16380
* Android: Fix support for cxxabi.h with libc++Brad King2016-10-072-0/+5
| | | | | | Additional include directories are needed for this on some STL types. Closes: #16350
* Android: Suppress -Wattributes warnings in test case buildsBrad King2016-10-061-2/+2
| | | | | | | | | | | | | | We use `-Werror` in the Android test builds to make sure there are no warnings that we care about (e.g. unused flags). However, the NDK r13 tools produce a warning about their own builtins: ``` <built-in>: In function 'float abs(float)': <built-in>: warning: conflicts with previous declaration here [-Wattributes] ``` Suppress this warning so that we can continue using `-Werror` but tolerate these warnings.
* Android: Add `ANDROID` variable to indicate the targetBrad King2016-08-231-0/+4
| | | | | Allow projects to use `if(ANDROID)` to condition their Android-specific code paths.
* Android: Add test cases covering use of the NDK and standalone toolchainsBrad King2016-08-2351-0/+547