[CMake] Prevent libraries from linking twice during LLVM build

Sanjay Srivallabh Singapuram singapuram.sanjay at gmail.com
Thu Apr 20 11:56:54 EDT 2017


Hello,

I'm proposing a patch to the Polly/LLVM project that involves linking
libPolly.a or libPolly.so to NVPTX back-end libraries. I'm currently using,
target_link_libraries(Polly
      LLVMNVPTXCodeGen
      LLVMNVPTXInfo
      LLVMNVPTXDesc
      LLVMNVPTXAsmPrinter
      )

The opt binary links to both Polly and NVPTX back-end libraries, therefore
including the back-end libraries twice which causes problems. Can linking
the libraries as an INTERFACE to Polly solve the problem ?

target_link_libraries(Polly INTERFACE
      LLVMNVPTXCodeGen
      LLVMNVPTXInfo
      LLVMNVPTXDesc
      LLVMNVPTXAsmPrinter
      )

Thank You,
Sanjay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170420/97a87bb0/attachment.html>


More information about the CMake mailing list