Cannot compile basic android sample with latest cmake and ndk 20 on OSX
Hi, I am facing an issue with CMake 3.14.5 and the ndk 20.0.5594570.
I just copy the basic toolchain from here. But my config of cmake failed all the time.
It seems the issue is related to the flag --sysroot who are not supported but I am not sure why. I also test this basic sample on a MacBookPro, MacPro and MacMini this issue it's happening each time.
Thanks
Here the issue:
-- Check for working C compiler: /Users/anthony.liot/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -- broken
CMake Error at /usr/local/Cellar/cmake/3.14.5/share/cmake/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"/.../Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang"
is not able to compile a simple test program.
It fails with the following output:
Run Build Command(s):/usr/local/bin/ninja cmTC_a1f1c
[1/2] Building C object CMakeFiles/cmTC_a1f1c.dir/testCCompiler.c.o
[2/2] Linking C executable cmTC_a1f1c
FAILED: cmTC_a1f1c
: && /.../Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang --target=aarch64-none-linux-android --gcc-toolchain=/.../Library/Android/sdk/ndk-bundle/toolchains//prebuilt/darwin-x86_64 --sysroot=/.../Library/Android/sdk/ndk-bundle/platforms/android-28/arch-arm64 -funwind-tables -no-canonical-prefixes -D__ANDROID_API__=28 -fexceptions -g -Wl,--gc-sections CMakeFiles/cmTC_a1f1c.dir/testCCompiler.c.o -o cmTC_a1f1c && :
ld: unknown option: --sysroot=/.../Library/Android/sdk/ndk-bundle/platforms/android-28/arch-arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.