Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 4,163
    • Issues 4,163
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 19
    • Merge requests 19
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMakeCMake
  • CMakeCMake
  • Merge requests
  • !4372

WIP: Android: Add hooks for NDK to replace CMake Platform/Android* modules

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Brad King requested to merge brad.king/cmake:android-ndk-hooks into master Feb 18, 2020
  • Overview 5
  • Commits 1
  • Pipelines 1
  • Changes 10

The Android NDK comes with a toolchain file that intends to handle all Android-related settings and avoid using CMake's own Android support. However, it includes many settings in the toolchain file itself that are supposed to belong in Platform/Android*.cmake modules. Normally third-party platforms can be configured using a toolchain file that sets CMAKE_MODULE_PATH to a directory with Platform/<os>*.cmake modules, but that does not work when CMake comes with builtin modules for that platform due to policy CMP0017.

Add an undocumented CMAKE_ANDROID_NDK_HOOK_DIR variable for use by the Android NDK's toolchain file to specify a directory with modules that hook into CMake's modules. Teach each Platform/Android*.cmake module to include a like-named module from the specified hook directory and then skip the rest of its logic. Also offer a per-module option to not skip the rest of its logic, just in case.

This hook is needed for any Platform/Android*.cmake module that is included by other CMake builtin modules since CMP0017 prevents CMAKE_MODULE_PATH from overriding such includes.

Issue: #18787 (closed)
NDK-Issue: https://github.com/android/ndk/issues/463

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: android-ndk-hooks