diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2013-12-10 20:10:10 -0800 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-20 02:42:31 +0100 |
commit | 08841c1c2f436fb304b3766114c4525ba21c63ba (patch) | |
tree | 7ad35775a654ba8972cd9cbea133f162f2394442 /qmake | |
parent | 0b144bc76a368ecc6c5c1121a1b51e888a0621ac (diff) |
Don't scan system includes for dependencies and don't list them
Assume that C and C++ headers found in system paths will not change,
so we don't need to tell Make about them, nor do we need to scan their
contents either.
The previous qmake behavior matched gcc's -M switch; it now matches
the -MM switch:
-M Instead of outputting the result of preprocessing, output a
rule suitable for make describing the dependencies of the
main source file.
-MM Like -M but do not mention header files that are found in
system header directories, nor header files that are
included, directly or indirectly, from such a header.
This goes hand-in-hand with our use of -isystem to pass system paths
to the compiler.
Change-Id: I3346b6da496fe6495ac89c5286d066b343116f0e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/generators/makefiledeps.cpp | 2 | ||||
-rw-r--r-- | qmake/generators/unix/unixmake2.cpp | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/qmake/generators/makefiledeps.cpp b/qmake/generators/makefiledeps.cpp index e1fb42e0a4..edc9a0ed7f 100644 --- a/qmake/generators/makefiledeps.cpp +++ b/qmake/generators/makefiledeps.cpp @@ -679,7 +679,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file) } else { exists = QFile::exists(lfn.real()); } - if(!lfn.isNull()) { + if (!lfn.isNull() && !isSystemInclude(lfn.real())) { dep = files->lookupFile(lfn); if(!dep) { dep = new SourceFile; diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 8e18f69c03..eb68614fe6 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -1229,8 +1229,10 @@ void UnixMakefileGenerator::init2() } if (include_deps && project->isActiveConfig("gcc_MD_depends")) { - project->values("QMAKE_CFLAGS") += "-MD"; - project->values("QMAKE_CXXFLAGS") += "-MD"; + // use -MMD if we know about -isystem too + ProString MD_flag(project->values("QMAKE_CFLAGS_ISYSTEM").isEmpty() ? "-MD" : "-MMD"); + project->values("QMAKE_CFLAGS") += MD_flag; + project->values("QMAKE_CXXFLAGS") += MD_flag; } if(!project->isEmpty("QMAKE_BUNDLE")) { |