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

How to cross build md5 exsample for android? #93

Open
zuowanbushiwo opened this issue Aug 27, 2021 · 0 comments
Open

How to cross build md5 exsample for android? #93

zuowanbushiwo opened this issue Aug 27, 2021 · 0 comments

Comments

@zuowanbushiwo
Copy link

After reading some documents ,I try cross-compile packages for Android platform: Using toolchain from Android NDK

I used my own /opt/toolchains/android-aarch64.cmake :

set(ANDROID_ABI arm64-v8a)
set(CMAKE_SIZEOF_VOID_P 8)

set(CMAKE_LIBRARY_ARCHITECTURE "aarch64-linux-android")
set(CMAKE_C_LIBRARY_ARCHITECTURE ${CMAKE_LIBRARY_ARCHITECTURE})
set(CMAKE_CXX_LIBRARY_ARCHITECTURE ${CMAKE_LIBRARY_ARCHITECTURE})

if(NOT DEFINED ANDROID_NDK)
    set(ANDROID_NDK "$ENV{ANDROID_NDK_ROOT}")
endif()
if(NOT DEFINED ANDROID_NATIVE_API_LEVEL)
    set(ANDROID_NATIVE_API_LEVEL $ENV{ANDROID_PLATFORM})
endif()
if(NOT DEFINED ANDROID_STL)
    set(ANDROID_STL "c++_shared")
endif()
if(NOT DEFINED ANDROID_LD)
    set(ANDROID_LD lld)
endif()

include(${ANDROID_NDK}/build/cmake/android.toolchain.cmake)

And wirte a conan profile local_android-ndk-arm64-v8a.txt :

[settings]
arch=armv8
build_type=Release
compiler=clang
compiler.libcxx=c++_static
compiler.version=11
os=Android
os.api_level=25
[build_requires]
[options]
[env]
CONAN_CMAKE_TOOLCHAIN_FILE=/opt/toolchains/android-aarch64.cmake

then
first mkdir build && cd build
second, conan install --profile:host local_android-ndk-arm64-v8a.txt --build outdated --profile:build default ..
the step it seems is successful ,as:
image

third: cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/opt/toolchains/android-aarch64.cmake

this step have a  error output:
-- Conan: Adjusting output directories
-- Conan: Using cmake global configuration
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Current conanbuildinfo.cmake directory: /home/packager/examples/libraries/poco/md5/build
CMake Error at build/conanbuildinfo.cmake:1369 (message):
  Incorrect 'clang', is not the one detected by CMake: 'GNU'
Call Stack (most recent call first):
  build/conanbuildinfo.cmake:930 (conan_check_compiler)
  CMakeLists.txt:19 (conan_basic_setup)

Which step I did wrong?

Thanks!

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

No branches or pull requests

1 participant