forked from qt-creator/qt-creator
move postprocessing of INCLUDEPATH into ProFileEvaluator::accept()
the rationale is that postprocessing which is done by the generators (in some cases right at the point of emitting code to the makefile) should be abstracted inside the "medium-level" class which also does the path resolution done by the generators. along the way we also make minor fixes to the processing: - we pay attention to CONFIG+=no_include_pwd - we add the build dir as well when shadow building Change-Id: Ib389942fdc0470e05c1aa49e3615b6ac00241662 Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
@@ -231,7 +231,6 @@ public:
|
||||
QStringList newProjectFilesCumlative;
|
||||
ProFile *fileForCurrentProjectCumlative; // probably only used in parser thread
|
||||
TargetInformation targetInformation;
|
||||
QString resolvedMkspecPath;
|
||||
InstallsList installsList;
|
||||
QHash<QmakeVariable, QStringList> newVarValues;
|
||||
bool isDeployable;
|
||||
@@ -1892,7 +1891,6 @@ EvalResult *QmakeProFileNode::evaluate(const EvalInput &input)
|
||||
}
|
||||
}
|
||||
result->targetInformation = targetInformation(input.readerExact, readerBuildPass, input.buildDirectory, input.projectFilePath);
|
||||
result->resolvedMkspecPath = input.readerExact->resolvedMkSpec();
|
||||
result->installsList = installsList(readerBuildPass, input.projectFilePath, input.projectDir);
|
||||
|
||||
// update other variables
|
||||
@@ -2237,7 +2235,6 @@ void QmakeProFileNode::applyEvaluate(EvalResult *evalResult)
|
||||
if (m_validParse) {
|
||||
// update TargetInformation
|
||||
m_qmakeTargetInformation = result->targetInformation;
|
||||
m_resolvedMkspecPath = result->resolvedMkspecPath;
|
||||
|
||||
m_subProjectsNotToDeploy = result->subProjectsNotToDeploy;
|
||||
m_installsList = result->installsList;
|
||||
@@ -2317,13 +2314,10 @@ QStringList QmakeProFileNode::includePaths(QtSupport::ProFileReader *reader, con
|
||||
}
|
||||
|
||||
paths.append(reader->absolutePathValues(QLatin1String("INCLUDEPATH"), projectDir));
|
||||
paths.append(reader->absolutePathValues(QLatin1String("QMAKE_INCDIR"), projectDir));
|
||||
// paths already contains moc dir and ui dir, due to corrrectly parsing uic.prf and moc.prf
|
||||
// except if those directories don't exist at the time of parsing
|
||||
// thus we add those directories manually (without checking for existence)
|
||||
paths << mocDirPath(reader, buildDir) << uiDirPath(reader, buildDir);
|
||||
// qmake always adds "."
|
||||
paths << projectDir;
|
||||
paths.removeDuplicates();
|
||||
return paths;
|
||||
}
|
||||
@@ -2427,11 +2421,6 @@ TargetInformation QmakeProFileNode::targetInformation() const
|
||||
return m_qmakeTargetInformation;
|
||||
}
|
||||
|
||||
QString QmakeProFileNode::resolvedMkspecPath() const
|
||||
{
|
||||
return m_resolvedMkspecPath;
|
||||
}
|
||||
|
||||
InstallsList QmakeProFileNode::installsList(const QtSupport::ProFileReader *reader, const QString &projectFilePath, const QString &projectDir)
|
||||
{
|
||||
InstallsList result;
|
||||
|
||||
@@ -415,7 +415,6 @@ public:
|
||||
QString objectsDirectory() const;
|
||||
QByteArray cxxDefines() const;
|
||||
bool isDeployable() const;
|
||||
QString resolvedMkspecPath() const;
|
||||
|
||||
enum AsyncUpdateDelay { ParseNow, ParseLater };
|
||||
void scheduleUpdate(AsyncUpdateDelay delay);
|
||||
@@ -473,7 +472,6 @@ private:
|
||||
|
||||
QMap<QString, QDateTime> m_uitimestamps;
|
||||
TargetInformation m_qmakeTargetInformation;
|
||||
QString m_resolvedMkspecPath;
|
||||
QStringList m_subProjectsNotToDeploy;
|
||||
InstallsList m_installsList;
|
||||
|
||||
|
||||
@@ -538,10 +538,6 @@ void QmakeProject::updateCppCodeModel()
|
||||
}
|
||||
}
|
||||
|
||||
if (QmakeProFileNode *node = rootQmakeProjectNode())
|
||||
templatePart->headerPaths += ProjectPart::HeaderPath(node->resolvedMkspecPath(),
|
||||
ProjectPart::HeaderPath::IncludePath);
|
||||
|
||||
// part->precompiledHeaders
|
||||
templatePart->precompiledHeaders.append(pro->variableValue(PrecompiledHeaderVar));
|
||||
|
||||
|
||||
@@ -197,7 +197,25 @@ bool ProFileEvaluator::loadNamedSpec(const QString &specDir, bool hostSpec)
|
||||
|
||||
bool ProFileEvaluator::accept(ProFile *pro, QMakeEvaluator::LoadFlags flags)
|
||||
{
|
||||
return d->visitProFile(pro, QMakeHandler::EvalProjectFile, flags) == QMakeEvaluator::ReturnTrue;
|
||||
if (d->visitProFile(pro, QMakeHandler::EvalProjectFile, flags) != QMakeEvaluator::ReturnTrue)
|
||||
return false;
|
||||
|
||||
if (flags & QMakeEvaluator::LoadPostFiles) {
|
||||
// This is postprocessing which is hard-coded inside qmake's generators.
|
||||
|
||||
ProStringList &incpath = d->valuesRef(ProKey("INCLUDEPATH"));
|
||||
incpath += d->values(ProKey("QMAKE_INCDIR"));
|
||||
if (!d->isActiveConfig(QStringLiteral("no_include_pwd"))) {
|
||||
incpath.prepend(ProString(pro->directoryName()));
|
||||
// It's pretty stupid that this is appended - it should be the second entry.
|
||||
if (pro->directoryName() != d->m_outputDir)
|
||||
incpath << ProString(d->m_outputDir);
|
||||
}
|
||||
// The location of this is inconsistent among generators.
|
||||
incpath << ProString(d->m_qmakespec);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
QString ProFileEvaluator::propertyValue(const QString &name) const
|
||||
@@ -205,11 +223,6 @@ QString ProFileEvaluator::propertyValue(const QString &name) const
|
||||
return d->m_option->propertyValue(ProKey(name)).toQString();
|
||||
}
|
||||
|
||||
QString ProFileEvaluator::resolvedMkSpec() const
|
||||
{
|
||||
return d->m_qmakespec;
|
||||
}
|
||||
|
||||
#ifdef PROEVALUATOR_CUMULATIVE
|
||||
void ProFileEvaluator::setCumulative(bool on)
|
||||
{
|
||||
|
||||
@@ -93,8 +93,6 @@ public:
|
||||
const ProFile *pro) const;
|
||||
QString propertyValue(const QString &val) const;
|
||||
|
||||
QString resolvedMkSpec() const;
|
||||
|
||||
private:
|
||||
QString sysrootify(const QString &path, const QString &baseDir) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user