Simone Atzeni via llvm-dev
2016-Nov-20 22:00 UTC
[llvm-dev] add_library cannot create target "LLVMTarget" because an imported target with the same name already exists.
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
Chris Bieneman via llvm-dev
2016-Nov-28 22:22 UTC
[llvm-dev] add_library cannot create target "LLVMTarget" because an imported target with the same name already exists.
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
Simone Atzeni via llvm-dev
2016-Nov-28 22:26 UTC
[llvm-dev] add_library cannot create target "LLVMTarget" because an imported target with the same name already exists.
Hi Chris, sorry I was just using a dummy name for the library but that wasn’t the name that was giving me the error. However, what I am experiencing is that if I build and install my pass within the LLVM source I cannot install my library if I build it out-of-tree as a standalone library. The OpenMP runtime allows that though, any solution? Thanks! Best, Simone> On Nov 28, 2016, at 15:22, Chris Bieneman <beanz at apple.com> wrote: > > 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 >
Apparently Analagous Threads
- Looking for an out-of-source "Hello, world" LLVM/Clang pass example
- Insert CallInst within a function passing same parameters of the calling function.
- [LLVMdev] Walking thru CallGraph bottom up
- GlobalValue::AvailableExternallyLinkage
- [LLVMdev] Walking thru CallGraph bottom up