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.2k
    • Issues 4.2k
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • 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
  • !7689

Android/Clang: Tolerate undefined CMAKE_ANDROID_NDK_VERSION

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Boris Egorov requested to merge jightuse/cmake:master into master Sep 16, 2022
  • Overview 6
  • Commits 1
  • Pipelines 2
  • Changes 1

!5862 (merged), the previous fix for #21772 (closed), doesn't work with typical android toolchain file, like this one:

https://android.googlesource.com/platform/ndk/+/master/build/cmake/android-legacy.toolchain.cmake

The condition fails to work when CMAKE_ANDROID_NDK_VERSION is undefined: second part evaluates to true, although ndk version is not known.

I've encountered following environment where CMAKE_ANDROID_NDK_VERSION is used without definition:

  • Build uses android toolchain file, which sets CMAKE_SYSTEM_VERSION=1 and doesn't set CMAKE_ANDROID_NDK_VERSION.
  • Code in Platform/Android-Determine.cmake exits early when it detects toolchain usage (via value CMAKE_SYSTEM_VERSION=1). This file is the only place in cmake modules where variable CMAKE_ANDROID_NDK_VERSION is set, and by early return we skip this definition.

Topic-rename: android-clang-no-ndk-version

Edited Sep 16, 2022 by Brad King
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: master