forked from qt-creator/qt-creator
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:
@@ -1676,9 +1676,18 @@ QStringList QmakeProFile::includePaths(QtSupport::ProFileReader *reader, const F
|
|||||||
const FileName &buildDir, const QString &projectDir)
|
const FileName &buildDir, const QString &projectDir)
|
||||||
{
|
{
|
||||||
QStringList paths;
|
QStringList paths;
|
||||||
|
bool nextIsAnIncludePath = false;
|
||||||
foreach (const QString &cxxflags, reader->values(QLatin1String("QMAKE_CXXFLAGS"))) {
|
foreach (const QString &cxxflags, reader->values(QLatin1String("QMAKE_CXXFLAGS"))) {
|
||||||
|
if (nextIsAnIncludePath) {
|
||||||
|
nextIsAnIncludePath = false;
|
||||||
|
paths.append(cxxflags);
|
||||||
|
} else {
|
||||||
if (cxxflags.startsWith(QLatin1String("-I")))
|
if (cxxflags.startsWith(QLatin1String("-I")))
|
||||||
paths.append(cxxflags.mid(2));
|
paths.append(cxxflags.mid(2));
|
||||||
|
else
|
||||||
|
if (cxxflags.startsWith(QLatin1String("-isystem")))
|
||||||
|
nextIsAnIncludePath = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (const ProFileEvaluator::SourceFile &el,
|
foreach (const ProFileEvaluator::SourceFile &el,
|
||||||
|
|||||||
Reference in New Issue
Block a user