summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Android.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Android: Restore platform info and search paths shared with LinuxBrad King2023-07-131-0/+2
| | | | | | | | These were accidentally dropped by commit 1373373823 (enable_language: Establish target platform identification variables earlier, 2023-06-06, v3.27.0-rc1~3^2~1). Fixes: #25077
* enable_language: Establish target platform identification variables earlierBrad King2023-06-071-5/+0
| | | | | | | | Set target platform identification variables like `APPLE` and `LINUX` as soon as the target system is identified. This makes them available during toolchain and binutils selection. Fixes: #23333
* Android: Provide CMAKE_ANDROID_NDK_VERSION with NDK legacy toolchain fileBrad King2023-02-061-0/+2
| | | | | | | | | | | | | | | | This variable has been provided since commit 746906242d (Android: Detect NDK version number, 2021-02-26, v3.20.0-rc3~1^2~3) when using CMake's NDK support or the modern NDK toolchain file. Since commit 005e2cdfb0 (Android: Do not use gold for ndk >= r22, 2021-02-26, v3.20.0-rc3~1^2) we need the value in our compiler/platform information files, so provide it when using the NDK legacy toolchain file too. Revert commit 1c86e397fe (Android/Clang: Tolerate undefined CMAKE_ANDROID_NDK_VERSION, 2022-09-16, v3.25.0-rc1~118^2) since the variable should now always be defined. Issue: #21772 Fixes: #24386
* Android: Revert setting LINUX variable on Android target systemsBrad King2022-11-281-0/+1
| | | | | | | | | | Since commit 62cd3904bf (variable: Set LINUX variable on Linux target systems, 2022-08-10, v3.25.0-rc1~320^2), the `Platform/Android` module inherits the `LINUX` variable setting from `Platform/Linux`. While Android may use a Linux kernel, `CMAKE_SYSTEM_NAME` is not `Linux`, and the platform does not follow conventions of most Linux distributions. Fixes: #24196
* Android: Avoid searching API level directories matching architecture bitnessSergiu Deitsch2022-10-181-0/+6
| | | | | | | | | When cross-compiling for Android, the library path suffixes `/<number>/` refer to API level specific platform libraries instead of architecture bitness. Disable path suffix use under NDK to avoid incorrect inclusion of API level specific libraries below the targeted API level. Fixes: #23830
* Android: Fix search for binutilsHaibo Huang2021-03-301-50/+0
| | | | | | | | Set `CMAKE_SYSTEM_PROGRAM_PATH` in `Platform/Android-Initialize` instead of `Platform/Android` so it can be used in `CMakeFindBinUtils`. Also add the names `llvm-strip` and `llvm-ranlib` for the corresponding tools.
* Android: restructure android search pathsHaibo Huang2020-11-091-32/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: add NDK hooksHaibo Huang2020-10-301-0/+12
| | | | | This change adds hooks to key Android support files, so that NDK can inject information or change cmake behaviors.
* Android: Fix find_* search order within NDK for unified toolchainsHaibo Huang2020-10-231-0/+36
|
* Android: Root searches within the NDK for unified toolchainsHaibo Huang2020-10-231-0/+38
| | | | Set `CMAKE_FIND_ROOT_PATH_MODE_*` appropriately.
* Android: add support for native compilation, such as with the Termux appButta2019-10-151-0/+5
| | | | | | | | | The CMake support for Android assumes cross-compilation using the NDK, so stub out that Android NDK support and use the Linux support that's already invoked. Set CMAKE_HOST_SYSTEM_NAME to "Android", rather than "Linux". Issue: #19840
* Android: allow user to enable versioned sonameTom Yan2019-03-051-3/+5
|
* Android: Add `ANDROID` variable to indicate the targetBrad King2016-08-231-0/+2
| | | | | Allow projects to use `if(ANDROID)` to condition their Android-specific code paths.
* VS: Fix Tegra-Android platform linking of libraries by nameBrad King2014-09-301-0/+6
| | | | | | | Nsight Tegra Visual Studio Edition handles prefixing of library names with '-l' automatically, so teach the generator not to do so. Reported-by: Mourad Boufarguine <mourad@boufarguine.name>
* Add basic Android platform moduleBrad King2014-06-061-0/+9
| | | | | | | | | | | | | | | | | | Create a Platform/Android module that includes Platform/Linux since Android is based on Linux. Provide only the minimal settings needed to get builds with Android NDK toolchains to work. Disable use of RPATH since the Android loader ignores it and we cannot predict the install destination anyway. Android supports soname but shared library names must end in ".so" and we cannot represent the versioned names with associated symlinks on all host operating systems anyway. However, we do want the SONAME of library files to be set so that linking to them by path to the library file produces NEEDED entries with the soname and not the path. Add a new CMAKE_PLATFORM_NO_VERSIONED_SONAME setting to tell the cmTarget::GetLibraryNames method that not to use the VERSION or SOVERSION target properties in the soname.
* Revert "Modules: Add an Andriod platform file"Stephen Kelly2014-04-101-5/+0
| | | | | | | This reverts commit 77f06b145d57c4665ff5d71b89a70c54a009ad14. It may be re-added in the future when the requirements for that platform are better known and supported by CMake.
* Modules: Add an Andriod platform fileStephen Kelly2014-03-201-0/+5
It is much like Linux but has no SONAME or RPATH.