[Polly][CMake] Use the CMake Package instead of llvm-config in out-of-tree builds
commit087265ab2584ba18447dd911951db9ff60630aa1
authorPhilip Pfaffe <philip.pfaffe@gmail.com>
Tue, 11 Jul 2017 11:24:25 +0000 (11 11:24 +0000)
committerPhilip Pfaffe <philip.pfaffe@gmail.com>
Tue, 11 Jul 2017 11:24:25 +0000 (11 11:24 +0000)
tree68c4057807e6cb578ced84f39dc51545643dc1cb
parentcdfdcc87670d4e35cde0df57db67111b34aa63f7
[Polly][CMake] Use the CMake Package instead of llvm-config in out-of-tree builds

Summary:
As of now, Polly uses llvm-config to set up LLVM dependencies in an out-of-tree build.

This is problematic for two reasons:
1) Right now, in-tree and out-of-tree builds in fact do different things. E.g., in an in-tree build, libPolly depends on a handful of LLVM libraries, while in an out-of-tree build it depends on all of them. This means that we often need to treat both paths seperately.
2) I'm specifically unhappy with the way libPolly is linked right now, because it just blindly links against all the LLVM libs. That doesn't make a lot of sense. For instance, one of these libs is LLVMTableGen, which contains a command line definition of a -o option. This means that I can not link an out-of-tree libPolly into a tool which might want to offer a -o option as well.

This patch (mostly) drop the use of llvm-config  in favor of LLVMs exported cmake package. However, building Polly with unittests requires access to the gtest sources (in the LLVM source tree). If we're building against an LLVM installation, this source tree is unavailable and must specified. I'm using llvm-config to provide a default in this case.

Reviewers: Meinersbur, grosser

Reviewed By: grosser

Subscribers: tstellar, bollu, chapuni, mgorny, pollydev, llvm-commits

Differential Revision: https://reviews.llvm.org/D33299

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@307650 91177308-0d34-0410-b5e6-96231b3b80d8
CMakeLists.txt
cmake/CMakeLists.txt
lib/CMakeLists.txt
test/CMakeLists.txt
test/lit.cfg
test/lit.site.cfg.in