forked from qt-creator/qt-creator
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:
@@ -27,3 +27,4 @@ SOURCES += \
|
||||
ioutils.cpp
|
||||
|
||||
RESOURCES += proparser.qrc
|
||||
DEFINES += QMAKE_BUILTIN_PRFS
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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:
|
||||
|
||||
0
src/shared/proparser/spec_post.prf
Normal file
0
src/shared/proparser/spec_post.prf
Normal file
0
src/shared/proparser/spec_pre.prf
Normal file
0
src/shared/proparser/spec_pre.prf
Normal 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
|
||||
|
||||
Reference in New Issue
Block a user