AlisdairM
AlisdairM

Reputation: 21

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.

Upvotes: 1

Views: 865

Answers (1)

AlisdairM
AlisdairM

Reputation: 21

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.

Upvotes: 1

Related Questions