[CMake] Trying to get android toolchain setup for Crystax

Robert Dailey rcdailey.lists at gmail.com
Thu Mar 23 16:22:48 EDT 2017


Update:

Using the x86_64 version of the Crystax NDK worked. Meaning, the
directory name aligned with what CMake was expecting. However, the
question now is: Why didn't changing
CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG work?

On Thu, Mar 23, 2017 at 3:14 PM, Robert Dailey <rcdailey.lists at gmail.com> wrote:
> Sorry I guess it would help if I showed where the ANDROID_ variables
> are being defined:
>
> cmake .. -G"Ninja" -DCMAKE_BUILD_TYPE="Release"
> -DCMAKE_TOOLCHAIN_FILE="crystax.toolchain.cmake"
> -DBUILD_TESTING=OFF     -DANDROID_API=15
> -DANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.9
> -DANDROID_ABI=armeabi-v7a     -DANDROID_TOOLCHAIN_VERSION=4.9
> -DANDROID_STL=gnustl_static
>
> On Thu, Mar 23, 2017 at 3:03 PM, Robert Dailey <rcdailey.lists at gmail.com> wrote:
>> 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