I am trying to build libzmq for Android using CMake and the toolchain embedded in the NDK.
My system is MacOS 10.14.3
I freshly downloaded the latest NDK [r20] but the problem was here already with r19c.
The CMake process fails when it tries to compile a "simple test program" and says:
ld: unknown option: --sysroot=/Users/me/android-ndk-r20/platforms/android-28/arch-arm
I tried to compile another library (custom) to confirm that its a toolchain issue and got the same error.
--helpoutput of the compiler (from the embedded toolchain), I found this:
-isysroot <dir> Set the system root directory (usually /)
Could there be an issue with the NDK toolchain for MacOS that passes the
--sysroot parameter instead of the
Is there a workaround? (Like something to add in the CMake toolchain file maybe?)
Here is my CMake toolchain file :
set(CMAKE_SYSTEM_NAME Android) set(CMAKE_SYSTEM_VERSION 28) # API level set(CMAKE_ANDROID_ARCH_ABI armeabi-v7a) set(CMAKE_ANDROID_ARM_MODE ON) set(CMAKE_ANDROID_NDK /Users/me/android-ndk-r20) set(CMAKE_ANDROID_STL_TYPE c++_static)
In the meantime, I will run this through a Ubuntu docker image and see how it goes.