[cfe-dev] Standalone tools

Jacob Carlborg doob at me.com
Sun Apr 27 23:40:12 PDT 2014


On 28/04/14 07:35, Kim Gräsman wrote:

> Do you deploy to Unix-like systems only?

Yes, so far. I haven't been able to get my tool working on Windows yet.

> I'm guessing this works well there, because everything is rooted in /usr/bin, right?
>
> So:
>
>    /usr/bin/your-tool
>    /usr/bin/clang
>    /usr/lib/clang/3.5.0/include
>
> ?

It's rather:

/any/path/the/user/chooses/my-tool
/usr/lib/libclang.so
/usr/include/stdarg.h
/usr/include/stddef.h

Alternatively they can put libclang next to my tool.

> On Windows, the situation is a little different as everything installs
> into C:\Program Files\LLVM, including the headers. So the only way to
> have a tool find the headers would be to install it into LLVM's root
> directory, which seems a little intrusive...

I haven't really explored this on Windows yet.

>> For the include files, it also work to copy them to the
>> standard header locations.
>
> You mean the equivalent of /usr/lib/clang/3.5.0/include? If Clang was
> installed afterwards, wouldn't they conflict?

I was actually thinking of /usr/include or any other path that is by 
default searched in by the compiler.

> That sounds like a lovely idea.
>
> The only obvious way I can see, given the current state, to achieve
> some kind of isolation is to:
> - install IWYU into /usr/bin/include-what-you-use
> - install Clang headers into /usr/lib/include-what-you-use/<version>/include

Yes, seems to be the case.

> For Windows, replace "/usr" with some install directory, e.g.
> "C:\Program Files\IWYU"
>
> This is assuming the headers is the only thing I need to worry about,
> but for a syntax-only tool, it should be, right?

Yes, and the Clang libraries themselves. Unless you link statically.

-- 
/Jacob Carlborg




More information about the cfe-dev mailing list