diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-07-31 16:11:44 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-08-01 16:48:20 +0200 |
commit | 1c98f30e80f97d7d374c5230431c2899bece1eda (patch) | |
tree | 05681a362748fd82c5b78747b7a4b7cfc6aa9d87 /src/shared/proparser | |
parent | f1a3a2d00cc0bfbf6893d8aada24b4cb123ac8f0 (diff) | |
download | qt-creator-1c98f30e80f97d7d374c5230431c2899bece1eda.tar.gz |
add log() function
follow suit with qmake ...
using fputs() instead of the fancy handler functions, as this is only for
qmake, which would just print to stdout anyway.
Change-Id: I0433d8157ce8c6e580b3fec6f622896b972f7b48
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'src/shared/proparser')
-rw-r--r-- | src/shared/proparser/qmakebuiltins.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/shared/proparser/qmakebuiltins.cpp b/src/shared/proparser/qmakebuiltins.cpp index fe34bb868f..736d756d82 100644 --- a/src/shared/proparser/qmakebuiltins.cpp +++ b/src/shared/proparser/qmakebuiltins.cpp @@ -85,7 +85,7 @@ enum TestFunc { T_INVALID = 0, T_REQUIRES, T_GREATERTHAN, T_LESSTHAN, T_EQUALS, T_EXISTS, T_EXPORT, T_CLEAR, T_UNSET, T_EVAL, T_CONFIG, T_SYSTEM, T_RETURN, T_BREAK, T_NEXT, T_DEFINED, T_CONTAINS, T_INFILE, - T_COUNT, T_ISEMPTY, T_INCLUDE, T_LOAD, T_DEBUG, T_MESSAGE, T_WARNING, T_ERROR, T_IF + T_COUNT, T_ISEMPTY, T_INCLUDE, T_LOAD, T_DEBUG, T_LOG, T_MESSAGE, T_WARNING, T_ERROR, T_IF }; void QMakeEvaluator::initFunctionStatics() @@ -166,6 +166,7 @@ void QMakeEvaluator::initFunctionStatics() { "load", T_LOAD }, { "include", T_INCLUDE }, { "debug", T_DEBUG }, + { "log", T_LOG }, { "message", T_MESSAGE }, { "warning", T_WARNING }, { "error", T_ERROR }, @@ -1274,6 +1275,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateConditionalFunction( case T_DEBUG: // Yup - do nothing. Nothing is going to enable debug output anyway. return ReturnFalse; + case T_LOG: case T_ERROR: case T_WARNING: case T_MESSAGE: { @@ -1283,9 +1285,16 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateConditionalFunction( return ReturnFalse; } const QString &msg = m_option->expandEnvVars(args.at(0).toQString(m_tmp2)); - if (!m_skipLevel) - m_handler->fileMessage(fL1S("Project %1: %2") - .arg(function.toQString(m_tmp1).toUpper(), msg)); + if (!m_skipLevel) { + if (func_t == T_LOG) { +#ifdef PROEVALUATOR_FULL + fputs(msg.toLatin1().constData(), stderr); +#endif + } else { + m_handler->fileMessage(fL1S("Project %1: %2") + .arg(function.toQString(m_tmp1).toUpper(), msg)); + } + } return (func_t == T_ERROR && !m_cumulative) ? ReturnError : ReturnTrue; } #ifdef PROEVALUATOR_FULL |