surround loading of spec with loading spec_pre.prf and spec_post.prf

follow suit with qmake ...

once we move currently builtin functionality to these feature files,
things would break with qt4 (which does not have them). consequently,
we provide our own fallback versions of them.

Change-Id: Ie318f3419d78214472835c41ec1388977f2e9269
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
This commit is contained in:
Oswald Buddenhagen
2012-05-04 22:12:17 +02:00
parent ca2816db1a
commit 41bf7c896b
6 changed files with 17 additions and 0 deletions

View File

@@ -27,3 +27,4 @@ SOURCES += \
ioutils.cpp
RESOURCES += proparser.qrc
DEFINES += QMAKE_BUILTIN_PRFS

View File

@@ -9,4 +9,8 @@
<file>images/remove.png</file>
<file>proiteminfo.xml</file>
</qresource>
<qresource prefix="/qmake/features" >
<file>spec_pre.prf</file>
<file>spec_post.prf</file>
</qresource>
</RCC>

View File

@@ -885,6 +885,8 @@ bool QMakeEvaluator::loadSpec()
cool:
m_option->qmakespec = QDir::cleanPath(qmakespec);
if (!evaluateFeatureFile(QLatin1String("spec_pre.prf")))
return false;
QString spec = m_option->qmakespec + QLatin1String("/qmake.conf");
if (!evaluateFileDirect(spec, QMakeHandler::EvalConfigFile, LoadProOnly)) {
m_handler->configError(
@@ -901,6 +903,8 @@ bool QMakeEvaluator::loadSpec()
QString real_spec = orig_spec.isEmpty() ? m_option->qmakespec : orig_spec.toQString();
#endif
m_option->qmakespec_name = IoUtils::fileName(real_spec).toString();
if (!evaluateFeatureFile(QLatin1String("spec_post.prf")))
return false;
if (!m_option->cachefile.isEmpty()
&& !evaluateFileDirect(m_option->cachefile, QMakeHandler::EvalConfigFile, LoadProOnly)) {
return false;
@@ -1900,6 +1904,11 @@ bool QMakeEvaluator::evaluateFeatureFile(const QString &fileName)
goto cool;
}
}
#ifdef QMAKE_BUILTIN_PRFS
fn.prepend(QLatin1String(":/qmake/features/"));
if (QFileInfo(fn).exists())
goto cool;
#endif
return false;
cool:

View File

View File

View File

@@ -18,6 +18,9 @@ build_all:!build_pass {
SOURCES = main.cpp qmakeglobals.cpp qmakeparser.cpp qmakeevaluator.cpp profileevaluator.cpp qmakebuiltins.cpp proitems.cpp ioutils.cpp
HEADERS = qmakeglobals.h qmakeparser.h profileevaluator.h qmakeevaluator.h qmakeevaluator_p.h proitems.h ioutils.h
RESOURCES += proparser.qrc
DEFINES += QMAKE_BUILTIN_PRFS
DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
DEFINES += QT_USE_FAST_OPERATOR_PLUS QT_USE_FAST_CONCATENATION
DEFINES += PROEVALUATOR_CUMULATIVE PROEVALUATOR_INIT_PROPS