-
Notifications
You must be signed in to change notification settings - Fork 990
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
[question] CXX flags not applied with Android toolchain #13374
Comments
@memsharded any idea about the fix? thanks |
Hi @cocoza4 I am trying this (on Windows), and it seems to be working fine here:
The lines
Are all there, not sure why it wouldn't be working on your side. Also, it is not necessary to detail the full environment [buildenv] as you do, I think the Android toolchain is able to manage it. This profile works fine for me:
|
Maybe you want to report the Conan version, and also the CMake version (recommended >3.19 at least for Android), just in case. |
@memsharded I'm on Conan 1.58, CMake 3.22.1 |
If you can please share your full log/output, that might have some extra hint. |
|
I see these lines in my output that I miss in yours:
Not sure why. Next step is to test in Linux, but I would need to setup that I don't have that installed, it can be a bit more challenging. |
@memsharded thanks for your response, let me know if you need additional information. |
Hi @cocoza4 - I have been able to reproduce this issue. The cmake toolchain included in the Android NDK ( We follow the advice by the CMake maintainers (link here) of setting The android-ndk provided toolchain on the other had modifies I have had luck with:
Then I see the behaviour you expect. Do you have the ability to use a newer Android NDK while still targeting Android 21? |
@jcar87 @memsharded thank you very much, I've fixed the issue as you suggested. |
@jcar87 I am re-opening, to discuss if we should add ANDROID_USE_LEGACY_TOOLCHAIN_FILE to OFF automatically in our toolchain, it is possible that this will also impact other users? |
Implemented in #13459, for next 2.0.3 Adding a new conf to opt-in into this Android CMake toolchain behavior is the best we can do, it is a bit of a mess there with the injection of flags, there is not much Conan can do about it. |
What is your question?
Hi there,
I'm crossing compiling a simple hello package for
aarch64-linux-android
withandroid-ndk-r21
. In my profile, I specifiedtools.build:cxxflags
to pass additional flags, even though these flags appear inconan_toolchain.cmake
, it actually didn't get applied during the build.Steps to reproduce
conan new hello/0.1 -m=cmake_lib
aarch64-linux-android
profile, content belowVERBOSE=1 conan create . -pr:h /workspace/conan/profiles/aarch64-linux-android -pr:b default -tf=None
Some logs
conan_toolchain.cmake
As you can see,
-fvisibility-inlines-hidden -fno-omit-frame-pointer
appear in the toolchain but it didn't get applied when running cmake. How can I make these flags get applied?aarch64-linux-android
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: