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

Add docs for tools.android:cmake_legacy_toolchain #3146

Conversation

jcar87
Copy link
Contributor

@jcar87 jcar87 commented Apr 3, 2023

@@ -209,6 +209,7 @@ Displays all the Conan built-in configurations. There are 2 groups:
core:non_interactive: Disable interactive user input, raises error if input necessary
core:required_conan_version: Raise if current version does not match the defined range.
tools.android:ndk_path: Argument for the CMAKE_ANDROID_NDK
tools.android:cmake_legacy_toolchain: Value for ANDROID_USE_LEGACY_TOOLCHAIN_FILE in CMakeToolchain
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
tools.android:cmake_legacy_toolchain: Value for ANDROID_USE_LEGACY_TOOLCHAIN_FILE in CMakeToolchain
tools.android:cmake_legacy_toolchain: (boolean) Value for ANDROID_USE_LEGACY_TOOLCHAIN_FILE in CMakeToolchain

@@ -451,6 +451,8 @@ CMakeToolchain is affected by these ``[conf]`` variables:
- **tools.cmake.cmaketoolchain:toolchain_file** user toolchain file to replace the ``conan_toolchain.cmake`` one.
- **tools.cmake.cmaketoolchain:user_toolchain** list of user toolchains to be included from the ``conan_toolchain.cmake`` file.
- **tools.android:ndk_path** value for ``ANDROID_NDK_PATH``.
- **tools.android:cmake_legacy_toolchain**: value for ``ANDROID_USE_LEGACY_TOOLCHAIN_FILE``. It may be useful to set this to ``False`` if compiler flags
Copy link
Contributor

Choose a reason for hiding this comment

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

is it True by default? (if you're saying setting it to False is useful, I think you imply default True).
if so, why something considered legacy is activated by default?

@SSE4
Copy link
Contributor

SSE4 commented Apr 3, 2023

is there an official upstream documentation for that variable? I struggle to find one. if so, can we add a link here?

Copy link
Contributor

@SSE4 SSE4 left a comment

Choose a reason for hiding this comment

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

for conan user it's kinda non-trivial to understand here what's the difference between "legacy" and "normal" (I assume, or how is it called) toolchain file, and which one is used by default in conan, and when to use each of them. I would be grateful if you could explain these details a little bit more, for newcomers.

@czoido czoido added this to the 2.0.3 milestone Apr 3, 2023
@jcar87
Copy link
Contributor Author

jcar87 commented Apr 3, 2023

is there an official upstream documentation for that variable? I struggle to find one. if so, can we add a link here?

The changelog for https://github.com/android/ndk/wiki/Changelog-r23#r23c - where the flag can be used to work around this bug: android/ndk#1693

Versions of Android NDK >= r23 can use CMake's built-in integration with CMake >= 3.21. Some versions of the Android NDK however still revert back to the older implementation due to this particular thing. In practice, a user may only want to define this if they are having troubles with CMAKE_CXX_FLAGS and similar - as the legacy CMake toolchain file has issues with that. I believe our documentation clearly states that as the motivation - I will add some clarifications otherwise.

If you feel it's insufficiently documented by Android, please raise an issue in https://github.com/android/ndk.

@czoido czoido merged commit 9022695 into conan-io:release/2.0.3 Apr 3, 2023
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.

4 participants