[cfe-dev] Announcing include-what-you-use 0.1

Jason Haslam jason.haslam at gmail.com
Fri Feb 4 20:14:51 PST 2011

On Feb 4, 2011, at 4:46 PM, Francois Pichet wrote:

> On Fri, Feb 4, 2011 at 5:38 PM, Craig Silverstein <csilvers at google.com> wrote:
>> I am very pleased to announce the version 0.1 release of
>> include-what-you-use:
>>   http://code.google.com/p/include-what-you-use/
>> Include-what-you-use is a tool built on top of clang libraries, that
>> analyzes a C++ (or C) file to figure out what #includes are actually
>> needed.  It then lists the set of changes needed to get the file to
>> have minimal, direct #includes, that reflect the symbols the file
>> actual uses.
>> Include-what-you-use is a hard problem
>> (http://code.google.com/p/include-what-you-use/wiki/WhyIWYUIsDifficult),
>> so the results are not yet perfect.  But this is an ideal crowd to
>> make them more so!  (Especially since my knowledge of clang internals
>> is still pretty rudimentary, to say nothing of the dark, dusty corners
>> of C++.)  Feel free to play around with iwyu, and to submit patches to
>> improve it!
>> craig
> I  would really really like to see this lib included directly in the
> main clang svn repository, it would be easier to maintain, attract
> developers and keep up to date. I think the scope of iwuy is general
> purpose enough to justify it.
> My first comment is that this lib really needs a CMake makefile.
> I really want to build this thing using MSVC.

I wanted to try it out with CMake as well. I've attached a simple CMakeLists.txt file that seems to do the trick. Just drop it in the include-what-you-use directory and add:


at the end of tools/clang/CMakeLists.txt. Works for me :)


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CMakeLists.txt
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110204/58a9d78b/attachment.txt>
-------------- next part --------------

More information about the cfe-dev mailing list