Closed n-eq closed 3 years ago
This happens because ANDROID_ABI is not set and CMake uses a default setting.
if(NOT ANDROID_ABI)
set(ANDROID_ABI armeabi-v7a)
endif()
I don't know how to pass cmake parameters to android toolchain. And whether that is even possible with conan. As a workaround, you can create several toolchains files. E.g. arm64-v8a.android.toolchain.cmake
set(ANDROID_ABI arm64-v8a) include(path to /android.toolchain.cmake)
and then use it with conan CONAN_CMAKE_TOOLCHAIN_FILE=arm64-v8a.android.toolchain.cmake
On the other hand, here's another way you can build for Android. https://github.com/conan-io/conan-center-index/issues/4220#issuecomment-758486060
Hi @dmn-star, many thanks for the comments. I didn't find the three lines you mention:
if(NOT ANDROID_ABI)
set(ANDROID_ABI armeabi-v7a)
endif()
However, I solved the issue by adding ANDROID_ABI = "arm64-v8a"
to CMake
class's definitions
field before building.
I didn't find the three lines you mention:
They are in android.toolchain.cmake.
They are in android.toolchain.cmake.
Yes, but apparently they were removed in NDK version 23.0.7599858, which is the one I'm using.
Hello,
I am trying to cross-compile a library to both Android armv7 and armv8 platforms. The first one builds correctly, but when compiling for arch armv8 I noticed clang calls
-march=armv7-a
and--target=armv7-none-linux-androideabi22
in its command line (see the full log below).Here's the profile I am using (Android NDK 23.0.7599858, api level 22)
Environment Details (include every applicable attribute)
Steps to reproduce (Include if Applicable)
I am using the following command:
$ conan create . koinbra/android_arm64-v8a -s build_type=Release -o shared=False -o log4c:shared=False --profile android_arm64-v8a -j /Users/n-eq/Dev/akl/log4c/__liv/pkg_info/pkg_info_3.00.09/arm64_Release_static.json -tf None
Logs (Executed commands with output) (Include/Attach if Applicable)
conan.log
Is there something I'm doing wrong? I appreciate your help.