New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need instructions to run IWYU with a CMake project #164

Closed
vsapsai opened this Issue Jun 15, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@vsapsai
Copy link
Contributor

vsapsai commented Jun 15, 2015

Originally reported on Google Code with ID 164

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.

Reported by legalize@xmission.com on 2014-12-22 22:59:31

@vsapsai

This comment has been minimized.

Copy link
Contributor

vsapsai commented Jun 15, 2015

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.

Reported by kim.grasman on 2014-12-22 23:11:32

@vsapsai

This comment has been minimized.

Copy link
Contributor

vsapsai commented Jun 15, 2015

Yeah, a compilation database would be totally acceptable.

Reported by legalize@xmission.com on 2014-12-22 23:33:09

@vsapsai

This comment has been minimized.

Copy link
Contributor

vsapsai commented Jun 15, 2015

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

Reported by kim.grasman on 2015-03-02 20:25:15

  • Status changed: Fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment