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
  • !7801

FindJNI: replace CMAKE_ANDROID_API by CMAKE_SYSTEM_VERSION

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Sergiu Deitsch requested to merge sergiud/cmake:findjni-system-version into master Oct 17, 2022
  • Overview 4
  • Commits 1
  • Pipelines 2
  • Changes 1

In !7069 (merged) we used CMAKE_ANDROID_API to check the Android API level. However, CMAKE_SYSTEM_VERSION is the authoritative value.

When cross-compiling for Android, an unset CMAKE_ANDROID_API can result in failure to locate JNI because the NativeHelper component cannot be found. In this case, the component is falsely assumed to be available by default (and thus required) since the comparison against an unset CMAKE_ANDROID_API variable evaluates to true. Use CMAKE_SYSTEM_VERSION to determine the Android API level instead.

Issue: #23830 (closed)
Backport: release
Topic-rename: FindJNI-android-api

Edited Oct 17, 2022 by Brad King
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: findjni-system-version