Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake fails to find C and C++ compiler if the specified toolchain is clang #566

Closed
void-etoile opened this issue Nov 9, 2017 · 1 comment

Comments

@void-etoile
Copy link


Description

If trying to build with the NDK and cmake as described here:

https://cmake.org/cmake/help/v3.7/manual/cmake-toolchains.7.html#id20

it will work when using GCC as the toolchain but fails with clang (paths to the clang C and C++ compilers will be malformed). e.g.:

/Users/james/Downloads/android-ndk-r16-beta2/toolchains//prebuilt/darwin-x86_64/bin/clang is not a full path to an existing compiler tool.

Notice the missing "llvm" in the path. This can be reproduced with r15c and r16 Beta 2.

I attach a minimal test case that will repro the problem if you open a terminal in the root folder and run the following command:

cmake -DCMAKE_TOOLCHAIN_FILE=./toolchain.cmake ./

Please note you will have to set the path to your NDK in the .toolchain file as I obviously cannot guess where the NDK is on your hard drive.

ndk_repro.zip

Environment Details

  • NDK Version: r15c or r16 Beta 2
  • Build sytem: cmake 3.7 or later
  • Host OS: Tested on both Mac & Windows
  • Compiler: clang
  • ABI: arm64-v8a
  • STL: NA
  • NDK API level: 21
  • Device API level: NA
@void-etoile
Copy link
Author

void-etoile commented Nov 9, 2017

I just saw in #504 that this is fixed with CMake 3.9.2 and above. Confirm it works with 3.9.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant