[CMake] Link unittests only against libLLVM.so, if available.
authorMichael Kruse <llvm@meinersbur.de>
Fri, 21 Apr 2017 19:03:51 +0000 (19:03 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Fri, 21 Apr 2017 19:03:51 +0000 (19:03 +0000)
commitab6b47d2e75c8d3cb178d4ce60f7d416cff301cc
treea34e0bd9b06fc78e9b372fec776f79eac325359f
parent22e839f4b2d2406c81bf31a343ee0afa73e53bcb
[CMake] Link unittests only against libLLVM.so, if available.

We can only link against libLLVM.so or the individual libLLVM*.so
components, but not both of them. Doing so results in these components
exist twice in the programs address space, since it is already contained
in libLLVM.so. The observable effect of this is that command line
switches are registered multiple times (once for each instance),
which is an error.

This fixes llvm.org/PR32735.

Reported-by: Singapuram Sanjay Srivallabh <singapuram.sanjay@gmail.com>
llvm-svn: 301020
polly/unittests/CMakeLists.txt