Skip to content

Use "android-xx" format for ANDROID_PLATFORM - #11799

Merged
franramirez688 merged 4 commits into
conan-io:developfrom
DDoSolitary:patch-1
Aug 11, 2022
Merged

franramirez688 merged 4 commits into
conan-io:developfrom
DDoSolitary:patch-1

Conversation

@DDoSolitary

@DDoSolitary DDoSolitary commented Aug 7, 2022

Copy link
Copy Markdown
Contributor

Changelog: Bugfix: Use "android-" format for the ANDROID_PLATFORM argument to be compatible with old NDK versions.
Docs: omit

Closes: #11798

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.

Fixes #11798

Old NDK versions only support "android-<level>" format for the ANDROID_PLATFORM argument.
@CLAassistant

CLAassistant commented Aug 7, 2022

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@franramirez688

Copy link
Copy Markdown
Contributor

Hi @DDoSolitary

Thanks for your contribution! The PR looks good! One point about it, let me add a little check in our tests to verify that we're setting the variable correctly. Let me know if you have any other doubt.

@franramirez688 franramirez688 added this to the 1.52 milestone Aug 8, 2022
Comment thread conans/test/integration/toolchains/cmake/test_cmaketoolchain.py Outdated

ctxt_toolchain = {
'android_platform': self._conanfile.settings.os.api_level,
'android_platform': 'android-' + str(self._conanfile.settings.os.api_level),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Android is not sufficiently tested in our CI.
Are we completely sure that this format android-xxx does not break for more modern API levels? It is compatible for all current (and hopefully future) levels?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as it's shown in the official documentation, https://developer.android.com/ndk/guides/cmake?hl=es-419#android_platform is not saying anything about "restrictions" in terms of using android-xxx for modern versions, so it should work as usual.

From official docs:

Multiple formats are accepted for this parameter:

* android-$API_LEVEL
* $API_LEVEL
* android-$API_LETTER

The $API_LETTER format allows you to specify android-N without the need to determine the number associated with that release. Note that some releases received an API increase without a letter increase. These APIs can be specified by appending the -MR1 suffix. For example, API level 25 is android-N-MR1.

@franramirez688 franramirez688 self-assigned this Aug 9, 2022
Comment thread conans/test/integration/toolchains/cmake/test_cmaketoolchain.py Outdated
Comment thread conans/test/integration/toolchains/cmake/test_cmaketoolchain.py Outdated
@franramirez688
franramirez688 merged commit 18238de into conan-io:develop Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] CMakeToolchain doesn't work with NDK r18b

4 participants