[llvm-dev] add_library cannot create target "LLVMTarget" because an imported target with the same name already exists.

Chris Bieneman via llvm-dev llvm-dev at lists.llvm.org
Mon Nov 28 14:22:40 PST 2016


Hi Simone,

Sorry for the delayed response.

LLVMTarget is a library provided by LLVM, you shouldn't be naming your own targets to conflict with the names already in LLVM. CMake does not allow multiple targets to have the same name because it causes ambiguities in the build system.

-Chris

> On Nov 20, 2016, at 2:00 PM, Simone Atzeni via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Hi,
> 
> I am trying to make my pass compiling inside the LLVM tree or outside.
> It works when I include my pass inside the tools folder, however when I try to compile it outside the LLVM tree I get the following error:
> 
> "add_library cannot create target "LLVMTarget" because an imported target with the same name already exists.”
> 
> It happens when I’ve already compiled and installed my target from within LLVM.
> 
> I was wondering if there is a way to ignore that and just overwrite the target.
> 
> Thanks.
> Best,
> Simone
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



More information about the llvm-dev mailing list