Open htonakanya opened 1 year ago
Hi @htonakanya
Thanks for your question.
It seems you are using a Conan 1.X configuration in [env]
that does nothing in Conan 2.0.
To define env-vars in Conan 2.0 (and also works in 1.X with the new generators like VirtualBuildEnv
) is more like:
[buildenv]
ANDROID_NDK_HOME=(path)/opt/android-ndk
Also, all the CONAN_XXX
variables are no longer used in the new generators (not only in 2.0, but also in the new generators in 1.X) like CMakeDeps and CMakeToolchain. The equivalent is done with conf
like:
[conf]
tools.build:cxxflags=[...]
tools.gnu:make_program=...
Check https://docs.conan.io/2/reference/config_files/global_conf.html and the output of conan config list
It also seems that you are using the old cross-compile model with arch_build=x86_64
and os_build
. But that should fail in Conan 2.0, there is something not right there.
Hi @memsharded,
Thank you for the reply, I'll try to fix the profiles and see whether it helps
I suspect this is due to https://stackoverflow.com/questions/40054495/set-cmake-prefix-path-not-working-with-android-toolchain . At least in similar (or equivalent) use case for me with conan 2.x .
If one enables set(CMAKE_FIND_DEBUG_MODE ON)
in the "test_package" CMakeLists.txt you can see in the output that the "CMAKE_PREFIX_PATH" contains the the "test_package/.../generators" directory where the CMake config for the main package is found.
Linux and Windows are fine (at least when cross-compile is not involved), but when Android toolchain is involved CMAKE_PREFIX_PATH gets ignored and find_package skips looking into "test_package/.../generators".
Adding the following in the test_package
CMakeLists.txt makes find_package look into those directories when using Android toolchain:
if(ANDROID)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)
endif(ANDROID)
alternatively specifying the directory explicitly also works (but one has to map it properly as it's dynamic based on Conan profile)
set(<main lib>_DIR <test_package/.../generator>)
I wonder if there is a cleaner way to address this (or at least streamline across many packages through the profiles/other Conan instrumentation).
Perhaps I am misusing Conan with this workflow and there's a better way. Open to suggestions!
What is your question?
Hi there, I'm trying to create a Conan 2.0 package, and I'm encountering an issue when building the test package for Android. The sources are attached. The build is successful for other platforms such as Win64, iOS, MacOS, Linux(x86, x64, armv7, and armv8). However, I'm getting the following error:
I'm using the following configuration:
I would appreciate it if someone could review this configuration and let me know if I'm missing any Android-specific configuration or if this issue might be a bug.
I attempted to resolve the issue by including the isa-l-config.cmake file in the package, but unfortunately, it did not solve the problem. I would like to know if the isa-l-config.cmake file is the root cause of the issue, and if so, what should be the content of the file and where should it be placed within the package. Additionally, I'm curious to understand why the package builds successfully on other platforms but it needs this config.cmake file for Android.
Thanks in advance.
Have you read the CONTRIBUTING guide?