diff options
Diffstat (limited to 'qmake/library')
-rw-r--r-- | qmake/library/proitems.cpp | 2 | ||||
-rw-r--r-- | qmake/library/proitems.h | 1 | ||||
-rw-r--r-- | qmake/library/qmakebuiltins.cpp | 2 | ||||
-rw-r--r-- | qmake/library/qmakeevaluator.cpp | 19 | ||||
-rw-r--r-- | qmake/library/qmakeevaluator.h | 4 | ||||
-rw-r--r-- | qmake/library/qmakeparser.cpp | 8 |
6 files changed, 14 insertions, 22 deletions
diff --git a/qmake/library/proitems.cpp b/qmake/library/proitems.cpp index ebe26a46e2..b0e3414e46 100644 --- a/qmake/library/proitems.cpp +++ b/qmake/library/proitems.cpp @@ -345,7 +345,7 @@ QTextStream &operator<<(QTextStream &t, const ProString &str) return t; } -static QString ProStringList_join(const ProStringList &this_, const QChar *sep, const size_t sepSize) +static QString ProStringList_join(const ProStringList &this_, const QChar *sep, const int sepSize) { int totalLength = 0; const int sz = this_.size(); diff --git a/qmake/library/proitems.h b/qmake/library/proitems.h index cd7af34108..13693837b9 100644 --- a/qmake/library/proitems.h +++ b/qmake/library/proitems.h @@ -275,6 +275,7 @@ enum ProToken { TokRemove, // variable -= TokReplace, // variable ~= // previous literal/expansion is a variable manipulation + // - lower bound for expected output length (1) // - value expression + TokValueTerminator TokValueTerminator, // assignment value terminator TokLiteral, // literal string (fully dequoted) diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp index 0dedd64e6e..be0d8ea172 100644 --- a/qmake/library/qmakebuiltins.cpp +++ b/qmake/library/qmakebuiltins.cpp @@ -195,7 +195,7 @@ static bool isTrue(const ProString &_str, QString &tmp) return !str.compare(statics.strtrue, Qt::CaseInsensitive) || str.toInt(); } -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) && defined(PROEVALUATOR_FULL) static QString windowsErrorCode() { wchar_t *string = 0; diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp index 0515fe1c98..c60119615f 100644 --- a/qmake/library/qmakeevaluator.cpp +++ b/qmake/library/qmakeevaluator.cpp @@ -1242,10 +1242,11 @@ void QMakeEvaluator::setupProject() { setTemplate(); ProValueMap &vars = m_valuemapStack.top(); - vars[ProKey("TARGET")] << ProString(QFileInfo(currentFileName()).baseName()); - vars[ProKey("_PRO_FILE_")] << ProString(currentFileName()); - vars[ProKey("_PRO_FILE_PWD_")] << ProString(currentDirectory()); - vars[ProKey("OUT_PWD")] << ProString(m_outputDir); + ProFile *proFile = currentProFile(); + vars[ProKey("TARGET")] << ProString(QFileInfo(currentFileName()).baseName()).setSource(proFile); + vars[ProKey("_PRO_FILE_")] << ProString(currentFileName()).setSource(proFile); + vars[ProKey("_PRO_FILE_PWD_")] << ProString(currentDirectory()).setSource(proFile); + vars[ProKey("OUT_PWD")] << ProString(m_outputDir).setSource(proFile); } void QMakeEvaluator::evaluateCommand(const QString &cmds, const QString &where) @@ -1356,11 +1357,9 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile( loadDefaults(); } -#ifdef QT_BUILD_QMAKE for (ProValueMap::ConstIterator it = m_extraVars.constBegin(); it != m_extraVars.constEnd(); ++it) m_valuemapStack.first().insert(it.key(), it.value()); -#endif VisitReturn vr; @@ -1375,11 +1374,9 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile( evaluateCommand(m_option->precmds, fL1S("(command line)")); -#ifdef QT_BUILD_QMAKE // After user configs, to override them if (!m_extraConfigs.isEmpty()) - evaluateCommand("CONFIG += " + m_extraConfigs.join(' '), fL1S("(extra configs)")); -#endif + evaluateCommand(fL1S("CONFIG += ") + m_extraConfigs.join(QLatin1Char(' ')), fL1S("(extra configs)")); } debugMsg(1, "visiting file %s", qPrintable(pro->fileName())); @@ -1390,13 +1387,11 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile( if (flags & LoadPostFiles) { evaluateCommand(m_option->postcmds, fL1S("(command line -after)")); -#ifdef QT_BUILD_QMAKE // Again, to ensure the project does not mess with us. // Specifically, do not allow a project to override debug/release within a // debug_and_release build pass - it's too late for that at this point anyway. if (!m_extraConfigs.isEmpty()) - evaluateCommand("CONFIG += " + m_extraConfigs.join(' '), fL1S("(extra configs)")); -#endif + evaluateCommand(fL1S("CONFIG += ") + m_extraConfigs.join(QLatin1Char(' ')), fL1S("(extra configs)")); if ((vr = evaluateFeatureFile(QLatin1String("default_post.prf"))) == ReturnError) goto failed; diff --git a/qmake/library/qmakeevaluator.h b/qmake/library/qmakeevaluator.h index 4565a2cc15..59e3295f69 100644 --- a/qmake/library/qmakeevaluator.h +++ b/qmake/library/qmakeevaluator.h @@ -112,10 +112,8 @@ public: QMakeHandler *handler); ~QMakeEvaluator(); -#ifdef QT_BUILD_QMAKE void setExtraVars(const ProValueMap &extraVars) { m_extraVars = extraVars; } void setExtraConfigs(const ProStringList &extraConfigs) { m_extraConfigs = extraConfigs; } -#endif void setOutputDir(const QString &outputDir) { m_outputDir = outputDir; } ProStringList values(const ProKey &variableName) const; @@ -268,10 +266,8 @@ public: QStack<Location> m_locationStack; // All execution location changes QStack<ProFile *> m_profileStack; // Includes only -#ifdef QT_BUILD_QMAKE ProValueMap m_extraVars; ProStringList m_extraConfigs; -#endif QString m_outputDir; int m_listCount; diff --git a/qmake/library/qmakeparser.cpp b/qmake/library/qmakeparser.cpp index 557a779717..49b5429130 100644 --- a/qmake/library/qmakeparser.cpp +++ b/qmake/library/qmakeparser.cpp @@ -298,12 +298,12 @@ bool QMakeParser::read(ProFile *pro, const QString &in, int line, SubGrammar gra // Worst-case size calculations: // - line marker adds 1 (2-nl) to 1st token of each line // - empty assignment "A=":2 => - // TokHashLiteral(1) + hash(2) + len(1) + "A"(1) + TokAssign(1) + - // TokValueTerminator(1) == 7 (8) + // TokHashLiteral(1) + hash(2) + len(1) + "A"(1) + TokAssign(1) + 0(1) + + // TokValueTerminator(1) == 8 (9) // - non-empty assignment "A=B C":5 => - // TokHashLiteral(1) + hash(2) + len(1) + "A"(1) + TokAssign(1) + + // TokHashLiteral(1) + hash(2) + len(1) + "A"(1) + TokAssign(1) + 2(1) + // TokLiteral(1) + len(1) + "B"(1) + - // TokLiteral(1) + len(1) + "C"(1) + TokValueTerminator(1) == 13 (14) + // TokLiteral(1) + len(1) + "C"(1) + TokValueTerminator(1) == 14 (15) // - variable expansion: "$$f":3 => // TokVariable(1) + hash(2) + len(1) + "f"(1) = 5 // - function expansion: "$$f()":5 => |