Commit Graph

4 Commits

Author SHA1 Message Date
Philip Pfaffe d99c406e3d [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

llvm-svn: 307650
2017-07-11 11:24:25 +00:00
Philip Pfaffe cda7152fcb [Polly][CMake] Fix variable name in target exports
llvm-svn: 302888
2017-05-12 10:39:38 +00:00
Philip Pfaffe 5d790fc03c [Polly][Cmake] Add missing include paths to exported cmake config
llvm-svn: 301552
2017-04-27 16:03:42 +00:00
Michael Kruse a9520b94d5 [Cmake] Generate a PollyConfig.cmake.
Generate a PollyConfig.cmake for use with Cmake's find_package in
out-of-tree projects.

Contributed-by: Philip Pfaffe <philip.pfaffe@gmail.com>

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

llvm-svn: 297395
2017-03-09 17:58:20 +00:00