[cfe-dev] How to build a clang-tool out of the build tree?

Andrzej Warzynski via cfe-dev cfe-dev at lists.llvm.org
Thu Nov 14 01:14:42 PST 2019

Hello Laurent,

Have you tried the pre-build packages for Ubuntu or Darwin? I'm using 
them for my out-of-tree tutorial:


I'm not using LibTooling and LibASTMatchers myself, but from what I can 
see they are shipped in Homebrew packages for LLVM 9:

brew install llvm at 9

I haven't checked on Ubuntu. This is how you can install the packages 
there (for Ubuntu Bionic):

wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/bionic/ 
llvm-toolchain-bionic-9.0 main" sudo apt-get update
sudo apt-get install -y llvm-9 llvm-9-dev llvm-9-tools clang-9

In the past I hit similar issue - not being able to build LLVM in 
Travis-CI. Fortunately for me, the packages for Ubuntu and Darwin worked 
fine. Windows is a bit trickier. Speaking of building LLVM using free CI 
systems, I am yet to try https://drone.io/.


On 12/11/2019 19:17, Laurent Thévenoux via cfe-dev wrote:
> Hi,
> I’m trying to develop a clang-tool, following such kind of tutorial : 
> https://clang.llvm.org/docs/LibASTMatchersTutorial.html.
> I’m using GitHub with Travis-CI and I can’t build clang/llvm on Travis 
> because of the free-plan constraints. I’m wondering if it is possible to 
> build such a tool without having to build clang/llvm, i.e., is there a 
> way to simply install clang (from any package manager) with its 
> LibTooling and LibASTMatchers, to which I could link my tool with?
> Regards,
> Laurent
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

More information about the cfe-dev mailing list