[CMake] Trying to get android toolchain setup for Crystax

Robert Dailey rcdailey.lists at gmail.com
Thu Mar 23 16:03:38 EDT 2017


So I'm having no luck getting the Crystax NDK setup using built-in
android support in CMake 3.8.

I have the following toolchain file:

set( CMAKE_SYSTEM_NAME Android )
set( CMAKE_SYSTEM_VERSION ${ANDROID_API} )

# set( CMAKE_ANDROID_NDK $ENV{ANDROID_NDK} )
set( CMAKE_ANDROID_NDK "E:/android/crystax-ndk-10.3.2-stable" )
#set( CMAKE_ANDROID_API ${ANDROID_API} )
set( CMAKE_ANDROID_ARCH_ABI ${ANDROID_ABI} )
set( CMAKE_ANDROID_STL_TYPE ${ANDROID_STL} )
set( CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION ${ANDROID_TOOLCHAIN_VERSION} )

if( CMAKE_ANDROID_ARCH_ABI MATCHES "armeabi" )
    set( CMAKE_ANDROID_ARM_MODE ON )
    set( CMAKE_ANDROID_ARM_NEON OFF )
endif()


The logs output as follows:


-- Android: Targeting API '15' with architecture 'arm', ABI
'armeabi-v7a', and processor 'armv7-a'
-- Android: Selected GCC toolchain 'arm-linux-androideabi-4.9'
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:10 (project):
  The CMAKE_C_COMPILER:

    E:/android/crystax-ndk-10.3.2-stable/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc.exe

  is not a full path to an existing compiler tool.


The problem is the path to the toolchain it is trying to find is actually:


"E:\android\crystax-ndk-10.3.2-stable\toolchains\arm-linux-androideabi-4.9\prebuilt\windows\bin\arm-linux-androideabi-gcc.exe"

The one difference is that the path has "windows" in it instead of
"windows-x86_64". I installed the 32-bit version of Crystax NDK, not
the 64 bit one (not sure if that makes a difference, but my native
android code will not build with 64-bit compiler anyway).

How can I make it properly calculate the path? I tried setting this
but it did not change the behavior:

set( CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG windows )


More information about the CMake mailing list