felipeprov / include-what-you-use

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

IWYU is difficult to use with Qt projects #94

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
(extracted from issue 93)

What steps will reproduce the problem?
1. svn checkout http://vacuum-im.googlecode.com/svn/trunk/ vacuum-im-read-only
2. qmake -r vacuum.pro INSTALL_PREFIX=/usr
3. make -k CXX=/usr/bin/include-what-you-use

What is the expected output? What do you see instead?

For
#include <QString>

IWYU suggests
#include "qstring.h"

Also in Qt no need to analyze moc_*.cpp files

Original issue reported on code.google.com by kim.gras...@gmail.com on 18 Feb 2013 at 9:12

GoogleCodeExporter commented 8 years ago
Zaheer Chothia has posted mapping files for Qt in this mailing list discussion:
https://groups.google.com/forum/?fromgroups=#!topic/include-what-you-use/8ABKFKe
t6kA

Original comment by kim.gras...@gmail.com on 18 Feb 2013 at 9:15

GoogleCodeExporter commented 8 years ago
I think we should build something into the coming iwyu_driver.py to 
exclude/ignore certain files, like moc_*.cpp.

Original comment by kim.gras...@gmail.com on 18 Feb 2013 at 9:16

GoogleCodeExporter commented 8 years ago
Issue 152 has been merged into this issue.

Original comment by kim.gras...@gmail.com on 3 Aug 2014 at 8:40

GoogleCodeExporter commented 8 years ago
Since this comes up as the #1 hit on google for "include what you use qt"), I'd 
like to point out you can create your own map file with:

##/usr/include/qt4$ grep -r '^ *# *include' | grep -e "^Q[^:]*/Q" | perl -nle 
'm/^Q.*\/([^:]+).*["<]([^>Q]+)[">]/ && print qq@ { include: ["<$2>", private, 
"<$1>", public ] },@' | sort -u

looks like:
https://github.com/maqifrnswa/openmw/blob/include-what-you-use/qt4.imp

Original comment by showard...@gmail.com on 12 Jul 2015 at 4:41