Add support for system include directories in qmake project files

When system include paths are added via QMAKE_CXXFLAGS in a .pro file,
in order to use the -isystem parameter, they are not taken into account
by Qt Creator.

This patch adds support for -isystem parameter in QMAKE_CXXFLAGS
parsing.

Change-Id: Ibd25734ec9f3a18258c445804c4a17269d7522ed
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Antonio Di Monaco
2018-04-06 10:23:59 +02:00
parent 2d84e003ea
commit 916bc59cfb

View File

@@ -1676,9 +1676,18 @@ QStringList QmakeProFile::includePaths(QtSupport::ProFileReader *reader, const F
const FileName &buildDir, const QString &projectDir)
{
QStringList paths;
bool nextIsAnIncludePath = false;
foreach (const QString &cxxflags, reader->values(QLatin1String("QMAKE_CXXFLAGS"))) {
if (cxxflags.startsWith(QLatin1String("-I")))
paths.append(cxxflags.mid(2));
if (nextIsAnIncludePath) {
nextIsAnIncludePath = false;
paths.append(cxxflags);
} else {
if (cxxflags.startsWith(QLatin1String("-I")))
paths.append(cxxflags.mid(2));
else
if (cxxflags.startsWith(QLatin1String("-isystem")))
nextIsAnIncludePath = true;
}
}
foreach (const ProFileEvaluator::SourceFile &el,