qmake: Sync back changes from qttools

Copy back changes to qmake internals that were done in qttools.
This makes it easier to keep the qmakelib copies in sync.

The code guarded by PROEVALUATOR_CUMULATIVE is not used by qmake itself,
but only by lupdate and Qt Creator. It seems to be sensible to have the
same behavior with regards to feature file evaluation in both
projects. It was originally introduced in qttools for QTBUG-62478.

The change regarding QT_BOOTSTRAPPED is safe, because the 'process'
feature is available and off in the boostrapped case.

Change-Id: I030ca8b093c017040a9ff9f4bb09a7cca4aa8964
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Joerg Bornemann 2020-11-24 12:57:28 +01:00
parent 6269438af9
commit 032c536644
3 changed files with 13 additions and 2 deletions

View File

@ -2050,6 +2050,10 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFeatureFile(
#ifdef PROEVALUATOR_CUMULATIVE
bool cumulative = m_cumulative;
// Even when evaluating the project in cumulative mode to maximize the
// chance of collecting all source declarations, prfs are evaluated in
// exact mode to maximize the chance of them successfully executing
// their programmatic function.
m_cumulative = false;
#endif
@ -2058,6 +2062,13 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFeatureFile(
#ifdef PROEVALUATOR_CUMULATIVE
m_cumulative = cumulative;
if (cumulative) {
// As the data collected in cumulative mode is potentially total
// garbage, yet the prfs fed with it are executed in exact mode,
// we must ignore their results to avoid that evaluation is unduly
// aborted.
ok = ReturnTrue;
}
#endif
return ok;
}

View File

@ -311,7 +311,7 @@ QString QMakeGlobals::expandEnvVars(const QString &str) const
bool QMakeGlobals::initProperties()
{
QByteArray data;
#ifndef QT_BOOTSTRAPPED
#if QT_CONFIG(process)
QProcess proc;
proc.start(qmake_abslocation, QStringList() << QLatin1String("-query"));
if (!proc.waitForFinished())

View File

@ -38,7 +38,7 @@
#include <qhash.h>
#include <qstringlist.h>
#ifndef QT_BOOTSTRAPPED
#if QT_CONFIG(process)
# include <qprocess.h>
#endif
#ifdef PROEVALUATOR_THREAD_SAFE