gbjie / include-what-you-use

Automatically exported from code.google.com/p/include-what-you-use
Other
0 stars 0 forks source link

Need instructions to run IWYU with a CMake project #164

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Note that I'm not talking about how to build include-what-you-use itself with 
CMake from the clang tree.

I'm talking about using IWYU in a project that has a CMake baesd build.  I had 
to do a lot of farting around by using the Ninja generator and then editing the 
ninja rules to use include-what-you-use as the compiler.

Attempting to run CMake with the Unix Makefiles generator and the compiler set 
to include-what-you-use failed on the compiler tests performed by CMake.  I'm 
not sure if this is a CMake problem (no variable used for compiler in the 
generated Makefile for you to override on the command-line) or a problem with 
include-what-you-use during the CMake project generation phase.

Original issue reported on code.google.com by legal...@xmission.com on 22 Dec 2014 at 10:59

GoogleCodeExporter commented 9 years ago
IWYU and CMake aren't friendly :-)

See issue #87, we've tried to make them agree better, but we haven't found 
anything that makes sense yet.

One venue might be if IWYU could use compilation databases; CMake can generate 
those: http://clang.llvm.org/docs/JSONCompilationDatabase.html.

Original comment by kim.gras...@gmail.com on 22 Dec 2014 at 11:11

GoogleCodeExporter commented 9 years ago
Yeah, a compilation database would be totally acceptable.

Original comment by legal...@xmission.com on 22 Dec 2014 at 11:33

GoogleCodeExporter commented 9 years ago
r607 adds a Python driver that lets IWYU integrate with CMake's compilation 
database. I'll set this fixed.

Original comment by kim.gras...@gmail.com on 2 Mar 2015 at 8:25