Home Ask Login Register

Developers Planet

Your answer is one click away!

AlisdairM February 2016

Why do I get this error when trying to build Clang from source?

I have checked out the current tip-of-tree from the various Clang 'git' mirrors as described in the getting started page here: http://llvm.org/docs/GettingStarted.html

I then follow the instruction to generate the make files using CMake, like so: cmake -G 'Unix Makefiles' /Path/To/LLVM-Repository

This fails to configure with the following error - what is going wrong?

CMake Error at tools/clang/CMakeLists.txt:480 (add_custom_target): add_custom_target cannot create target "install-libclang-headers" because another target with the same name already exists. The existing target is a custom target created in source directory "/Users/alisdairm/Repositories/llvm/projects/clang/tools/libclang". See documentation for policy CMP0002 for more details.


AlisdairM February 2016

This is most likely a double-checkout of the Clang repository, once into the llvm/tools directory (correct) and a second into the llvm/projects directory (error).

The solution is to delete the copy of the Clang repository in the llvm/projects directory, and then everything should configure and build correctly.

Post Status

Asked in February 2016
Viewed 3,528 times
Voted 11
Answered 1 times


Leave an answer

Quote of the day: live life