extra-cmake-modules/toolchain/Android.cmake cache variables

David Faure faure at kde.org
Sat Jul 1 21:14:10 UTC 2017


Has toolchain/Android.cmake ever been tested with x86 target architecture rather than ARM? I'm experiencing multiple issues.

1) ANDROID_TOOLCHAIN must be set to x86 for the toolchains subdir but
to i686-linux-android for the prefix to gcc. Fixed with the attached patch.

2) Now I'm running cmake with -DCMAKE_TOOLCHAIN_FILE=/opt/android/kde/install/share/ECM/toolchain/Android.cmake
-DANDROID_ARCHITECTURE=x86 -DANDROID_TOOLCHAIN=x86 -DANDROID_ABI=x86 -DANDROID_COMPILER_PREFIX=i686-linux-android

This runs /opt/android/android-ndk-r10e/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-gcc (good),
but still with an ARM sysroot.
CMake output:

ANDROID_ARCHITECTURE=x86 CMAKE_SYSROOT=/opt/android/android-ndk-r10e/platforms/android-14/arch-x86
-- The C compiler identification is GNU 4.9.0
-- The CXX compiler identification is GNU 4.9.0
-- Check for working C compiler: /opt/android/android-ndk-r10e/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-gcc
ANDROID_ARCHITECTURE=arm CMAKE_SYSROOT=/opt/android/android-ndk-r10e/platforms/android-14/arch-arm

(the extra debug message is from me in Android.cmake)

Android.cmake assumes the variables will be read from CMakeCache.txt but I don't think this is how cmake toolchain files work.
Clearly it's getting the default value ("arm") when running the compiler, above.

I'm not sure what we can do about this, other than manually editing Android.cmake or providing one per architecture...

Anything I missed?

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecm.diff
Type: text/x-patch
Size: 2171 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-buildsystem/attachments/20170701/e1e11c11/attachment.bin>


More information about the Kde-buildsystem mailing list