diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-07-08 18:52:13 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2016-10-25 09:00:53 +0000 |
commit | 8e7e60dbdea04c943bc6d50290db12d3fefd39f2 (patch) | |
tree | 8cd4454158a6cda0dc0cf145ad524a967f6f67a0 | |
parent | 05b22932560a0e04b8135a1ac32940fe0bfc9f26 (diff) | |
download | qttools-8e7e60dbdea04c943bc6d50290db12d3fefd39f2.tar.gz |
prevent .prf files from postponing work to build passes
... as lupdate doesn't execute any. this increases the chance that we
will get a complete picture of the project.
this is preparation for lupdate interpreting .qrc files.
Task-number: QTBUG-53206
Change-Id: I5e10b44637d527799f55c578a99076eb4750f131
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
-rw-r--r-- | src/linguist/shared/exclusive_builds.prf | 6 | ||||
-rw-r--r-- | src/linguist/shared/proparser.pri | 3 | ||||
-rw-r--r-- | src/linguist/shared/proparser.qrc | 5 | ||||
-rw-r--r-- | src/linguist/shared/qmakeevaluator.cpp | 39 |
4 files changed, 39 insertions, 14 deletions
diff --git a/src/linguist/shared/exclusive_builds.prf b/src/linguist/shared/exclusive_builds.prf new file mode 100644 index 000000000..b312a4c58 --- /dev/null +++ b/src/linguist/shared/exclusive_builds.prf @@ -0,0 +1,6 @@ +# Lupdate doesn't execute the build passes, so prevent that they are +# created in the first place. This tricks for example resources.prf +# into actually creating the QML resource file, so we can scan it. + +defineTest(addExclusiveBuilds) { +} diff --git a/src/linguist/shared/proparser.pri b/src/linguist/shared/proparser.pri index 124227bc4..f3fcad515 100644 --- a/src/linguist/shared/proparser.pri +++ b/src/linguist/shared/proparser.pri @@ -23,3 +23,6 @@ SOURCES += \ $$PWD/qmakeevaluator.cpp \ $$PWD/qmakebuiltins.cpp \ $$PWD/profileevaluator.cpp + +RESOURCES += $$PWD/proparser.qrc +DEFINES += QMAKE_BUILTIN_PRFS QMAKE_OVERRIDE_PRFS diff --git a/src/linguist/shared/proparser.qrc b/src/linguist/shared/proparser.qrc new file mode 100644 index 000000000..77ffd258a --- /dev/null +++ b/src/linguist/shared/proparser.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/qmake/override_features" > + <file>exclusive_builds.prf</file> + </qresource> +</RCC> diff --git a/src/linguist/shared/qmakeevaluator.cpp b/src/linguist/shared/qmakeevaluator.cpp index 9314dabad..7387521d8 100644 --- a/src/linguist/shared/qmakeevaluator.cpp +++ b/src/linguist/shared/qmakeevaluator.cpp @@ -1952,23 +1952,34 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFeatureFile( // needs to be determined. Failed lookups are represented via non-null empty strings. QString *fnp = &m_featureRoots->cache[qMakePair(fn, currFn)]; if (fnp->isNull()) { - int start_root = 0; - const QStringList &paths = m_featureRoots->paths; - if (!currFn.isEmpty()) { - QStringRef currPath = IoUtils::pathName(currFn); - for (int root = 0; root < paths.size(); ++root) - if (currPath == paths.at(root)) { - start_root = root + 1; - break; - } - } - for (int root = start_root; root < paths.size(); ++root) { - QString fname = paths.at(root) + fn; - if (IoUtils::exists(fname)) { - fn = fname; +#ifdef QMAKE_OVERRIDE_PRFS + { + QString ovrfn(QLatin1String(":/qmake/override_features/") + fn); + if (QFileInfo::exists(ovrfn)) { + fn = ovrfn; goto cool; } } +#endif + { + int start_root = 0; + const QStringList &paths = m_featureRoots->paths; + if (!currFn.isEmpty()) { + QStringRef currPath = IoUtils::pathName(currFn); + for (int root = 0; root < paths.size(); ++root) + if (currPath == paths.at(root)) { + start_root = root + 1; + break; + } + } + for (int root = start_root; root < paths.size(); ++root) { + QString fname = paths.at(root) + fn; + if (IoUtils::exists(fname)) { + fn = fname; + goto cool; + } + } + } #ifdef QMAKE_BUILTIN_PRFS fn.prepend(QLatin1String(":/qmake/features/")); if (QFileInfo::exists(fn)) |