Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use "android-xx" format for ANDROID_PLATFORM #11799

Merged
merged 4 commits into from
Aug 11, 2022

Conversation

DDoSolitary
Copy link
Contributor

@DDoSolitary DDoSolitary commented Aug 7, 2022

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
Copy link

CLAassistant commented Aug 7, 2022

CLA assistant check
All committers have signed the CLA.

@franramirez688
Copy link
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
@@ -313,7 +313,7 @@ def context(self):
android_ndk_path = android_ndk_path.replace("\\", "/")

ctxt_toolchain = {
'android_platform': self._conanfile.settings.os.api_level,
'android_platform': 'android-' + str(self._conanfile.settings.os.api_level),
Copy link
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
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
@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