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

Firat Kasmis via cfe-dev cfe-dev at lists.llvm.org
Thu Nov 14 11:43:31 PST 2019


Hi Laurant,

this is exactly what you were looking for:
https://github.com/firolino/clang-tool

Use it as template project for your own standalone tool.

Best,
Firat


On Thu, Nov 14, 2019, 10:39 Pradeep Kumar via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hi Laurent,
>     Check out this repository
> <https://github.com/peter-can-talk/cppnow-2017> by Peter Goldsborough
> where he used docker to build clang tools.
>
> Regards,
> Pradeep
>
> On Thu, Nov 14, 2019 at 2:45 PM Andrzej Warzynski via cfe-dev <
> cfe-dev at lists.llvm.org> wrote:
>
>> Hello Laurent,
>>
>> Have you tried the pre-build packages for Ubuntu or Darwin? I'm using
>> them for my out-of-tree tutorial:
>>
>> https://github.com/banach-space/llvm-tutor
>>
>> 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/.
>>
>> -Andrzej
>>
>> 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
>> >
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20191114/a76781d3/attachment.html>


More information about the cfe-dev mailing list