From 3890988bb69c2a50d4ebdbcd8c4c7058ac364125 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 22 Oct 2015 10:39:59 +0200 Subject: Add support for -Zc:throwingNew option to vcxproj generation for 2015 Task-number: QTBUG-48898 Change-Id: I56abae0cbc56e07fd9bb554b84927c327c1b3232 Reviewed-by: Oswald Buddenhagen Reviewed-by: Maurice Kalinowski --- qmake/generators/win32/msvc_objectmodel.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'qmake') diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 09937c8ac2..1e522cc8ee 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -922,6 +922,8 @@ bool VCCLCompilerTool::parseOption(const char* option) TreatWChar_tAsBuiltInType = ((*c) == '-' ? _False : _True); else if (config->CompilerVersion >= NET2013 && strncmp(option + 4, "strictStrings", 13) == 0) AdditionalOptions += option; + else if (config->CompilerVersion >= NET2015 && strncmp(option + 4, "throwingNew", 11) == 0) + AdditionalOptions += option; else found = false; } else { -- cgit v1.2.3 From e59d39c6fd96bff7466cf655f4b67e83edf50d6e Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Thu, 16 Jul 2015 17:42:08 +0200 Subject: QmakeProject: Fix crash on updating sources ProFileCacheManager::discardFile(s) may remove an entry from the ProfileCache only when it is unused (which is the case iff ent->locker is zero). Change-Id: I9df2079087af6bd0d35dd121db6222e8a6ec9389 Task-number: QTCREATORBUG-14730 Reviewed-by: Oswald Buddenhagen (cherry picked from qtcreator/dedcd25924743e494055c1e0195aeef0f3983a1d) (cherry picked from qtcreator/b335b2a083e456e2b44b1e9454a0f4cd41e2a397) (cherry picked from qtcreator/a027cbcd7051c634a51b6029dcb8a5b4bfe8b046) Reviewed-by: Joerg Bornemann --- qmake/library/qmakeparser.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'qmake') diff --git a/qmake/library/qmakeparser.cpp b/qmake/library/qmakeparser.cpp index 3fd7957bc0..95a072392e 100644 --- a/qmake/library/qmakeparser.cpp +++ b/qmake/library/qmakeparser.cpp @@ -64,6 +64,18 @@ void ProFileCache::discardFile(const QString &fileName) #endif QHash::Iterator it = parsed_files.find(fileName); if (it != parsed_files.end()) { +#ifdef PROPARSER_THREAD_SAFE + if (it->locker) { + if (!it->locker->done) { + ++it->locker->waiters; + it->locker->cond.wait(&mutex); + if (!--it->locker->waiters) { + delete it->locker; + it->locker = 0; + } + } + } +#endif if (it->pro) it->pro->deref(); parsed_files.erase(it); @@ -80,6 +92,18 @@ void ProFileCache::discardFiles(const QString &prefix) end = parsed_files.end(); while (it != end) if (it.key().startsWith(prefix)) { +#ifdef PROPARSER_THREAD_SAFE + if (it->locker) { + if (!it->locker->done) { + ++it->locker->waiters; + it->locker->cond.wait(&mutex); + if (!--it->locker->waiters) { + delete it->locker; + it->locker = 0; + } + } + } +#endif if (it->pro) it->pro->deref(); it = parsed_files.erase(it); @@ -88,7 +112,6 @@ void ProFileCache::discardFiles(const QString &prefix) } } - ////////// Parser /////////// #define fL1S(s) QString::fromLatin1(s) -- cgit v1.2.3 From 3f723ff9a90087fad5e9be4afd5a8eee69ee694a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 9 Aug 2013 12:17:11 +0200 Subject: execute some loops even in cumulative mode we execute foreach loops now. this is (mostly) safe nowadays, because a previous change added precautions against exponential value list growth, so it's unlikely that two nested loops would keep the cpu busy for a day as before. we continue to exclude forever loops and loops with excessive integer counts. Task-number: QTBUG-8550 Change-Id: Iaa116086986cc7fd5023834753f791dd205102e5 Reviewed-by: Daniel Teske Reviewed-by: Oswald Buddenhagen (cherry picked from qttools/dd4d594c787a62fa8aa12695c5d115c71b59bacd) Reviewed-by: Joerg Bornemann --- qmake/library/qmakeevaluator.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'qmake') diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp index cfb95b946c..a1c2b5fcea 100644 --- a/qmake/library/qmakeevaluator.cpp +++ b/qmake/library/qmakeevaluator.cpp @@ -575,13 +575,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProBlock( okey = true, or_op = false; // force next evaluation break; case TokForLoop: - if (m_cumulative) { // This is a no-win situation, so just pretend it's no loop - skipHashStr(tokPtr); - uint exprLen = getBlockLen(tokPtr); - tokPtr += exprLen; - blockLen = getBlockLen(tokPtr); - ret = visitProBlock(tokPtr); - } else if (okey != or_op) { + if (m_cumulative || okey != or_op) { const ProKey &variable = pro->getHashStr(tokPtr); uint exprLen = getBlockLen(tokPtr); const ushort *exprPtr = tokPtr; @@ -751,6 +745,11 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProLoop( ProStringList list = values(it_list.toKey()); if (list.isEmpty()) { if (it_list == statics.strforever) { + if (m_cumulative) { + // The termination conditions wouldn't be evaluated, so we must skip it. + traceMsg("skipping forever loop in cumulative mode"); + return ReturnFalse; + } infinite = true; } else { const QString &itl = it_list.toQString(m_tmp1); @@ -761,6 +760,12 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProLoop( if (ok) { int end = itl.mid(dotdot+2).toInt(&ok); if (ok) { + if (m_cumulative && qAbs(end - start) > 100) { + // Such a loop is unlikely to contribute something useful to the + // file collection, and may cause considerable delay. + traceMsg("skipping excessive loop in cumulative mode"); + return ReturnFalse; + } if (start < end) { for (int i = start; i <= end; i++) list << ProString(QString::number(i)); -- cgit v1.2.3 From bbf2f1dbbfd862cb7bfb47e62ad54740990e5b82 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 8 Aug 2013 18:01:22 +0200 Subject: don't complain about missing include()s during cumulative evaluation it produces simply too many false positives. Change-Id: I3dfa109866450babe5c16f84665ad22024d99e42 Reviewed-by: Joerg Bornemann (cherry picked from qttools/08bae158320f6d73bf44fcf43f45f51a01334544) Reviewed-by: Joerg Bornemann --- qmake/library/qmakebuiltins.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'qmake') diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp index 02d5d5dd31..51ba6dc0a0 100644 --- a/qmake/library/qmakebuiltins.cpp +++ b/qmake/library/qmakebuiltins.cpp @@ -1387,6 +1387,8 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional( } QString parseInto; LoadFlags flags = 0; + if (m_cumulative) + flags = LoadSilent; if (args.count() >= 2) { parseInto = args.at(1).toQString(m_tmp2); if (args.count() >= 3 && isTrue(args.at(2), m_tmp3)) -- cgit v1.2.3 From 771724d2f47aefb24b1627a7e60cf3a90bcbe772 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Fri, 6 Sep 2013 15:14:38 +0200 Subject: ProParser: Plug raw data leak QProcessEnvironment caches keys, so we must not pass it QStrings created with fromRawData() Task-number: QTCREATORBUG-9142 Change-Id: I29fade02f3bc4110fafb1b04d44f2e653951a2ae Reviewed-by: Oswald Buddenhagen (cherry picked from qtcreator/99f15f1706868c4b2f84bc4164451bd69b3b8188) Reviewed-by: Joerg Bornemann --- qmake/library/qmakeevaluator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qmake') diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp index a1c2b5fcea..73ea10daf8 100644 --- a/qmake/library/qmakeevaluator.cpp +++ b/qmake/library/qmakeevaluator.cpp @@ -452,7 +452,7 @@ void QMakeEvaluator::evaluateExpression( break; } case TokEnvVar: { const ProString &var = pro->getStr(tokPtr); - const ProString &val = ProString(m_option->getEnv(var.toQString(m_tmp1))); + const ProString &val = ProString(m_option->getEnv(var.toQString())); debugMsg(2, "env var %s => %s", dbgStr(var), dbgStr(val)); addStr(val, ret, pending, joined); break; } -- cgit v1.2.3 From eba9769b7e794cf1df204d8365a84e7f70c5a510 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 14 Jan 2014 14:21:10 +0100 Subject: QmakeParser: Do not leak temporaries into cache of files This prevents an access to free'd memory when opening qtcreator.pro. Looks like qml2puppet.pro gets added to that cache in QMakeVfs::writeFile with part of the including pro-file's filename in it. That part gets cleaned when that containing ProFile goes out of scope, leaving a key in QMakeVfs::m_files free'd but accessible. Change-Id: I80b43d2fbb66c214647497ea97e6e3a587e274d6 Reviewed-by: Oswald Buddenhagen (cherry picked from qtcreator/336c3159617cdb3edd35021b5fb312d4d43f9a84) Reviewed-by: Joerg Bornemann --- qmake/library/qmakebuiltins.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'qmake') diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp index 51ba6dc0a0..4398937015 100644 --- a/qmake/library/qmakebuiltins.cpp +++ b/qmake/library/qmakebuiltins.cpp @@ -1556,7 +1556,9 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional( if (!args.at(2).toQString(m_tmp1).compare(fL1S("append"), Qt::CaseInsensitive)) mode = QIODevice::Append; } - return writeFile(QString(), resolvePath(args.at(0).toQString(m_tmp1)), mode, contents); + QString path = resolvePath(args.at(0).toQString(m_tmp1)); + path.detach(); // make sure to not leak m_tmp1 into the map of written files. + return writeFile(QString(), path, mode, contents); } case T_TOUCH: { if (args.count() != 2) { -- cgit v1.2.3 From 07ada2fb60d46e688c380148b23f0362a285a32f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 5 Feb 2014 19:54:01 +0100 Subject: micro-optimization: use ProStringList::join(QChar) overload Change-Id: I25c6205df78da7fbee0ad1b04476f528f376b7a6 Reviewed-by: Daniel Teske (cherry picked from qtcreator/701a82d3a2185702c09dfecb361853fc18947807) Reviewed-by: Joerg Bornemann --- qmake/library/qmakebuiltins.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qmake') diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp index 4398937015..bb07ad44a3 100644 --- a/qmake/library/qmakebuiltins.cpp +++ b/qmake/library/qmakebuiltins.cpp @@ -1551,7 +1551,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional( if (args.count() >= 2) { const ProStringList &vals = values(args.at(1).toKey()); if (!vals.isEmpty()) - contents = vals.join(fL1S("\n")) + QLatin1Char('\n'); + contents = vals.join(QLatin1Char('\n')) + QLatin1Char('\n'); if (args.count() >= 3) if (!args.at(2).toQString(m_tmp1).compare(fL1S("append"), Qt::CaseInsensitive)) mode = QIODevice::Append; -- cgit v1.2.3 From a8010f2d0387cf13f54cf01d2bc0877fbd055351 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 5 Feb 2014 21:26:37 +0100 Subject: fix raw data leak in $$sprintf() it could be only triggered by abusing the function (no expansion actually done), and nobody is using this to start with, but still ... Change-Id: I3d4a23ae4d1eea07955572d8213094e0dc218f6d Reviewed-by: Daniel Teske (cherry picked from qtcreator/cdc2a0f72334268684e0407e9b04b3188e00d4bf) Reviewed-by: Joerg Bornemann --- qmake/library/qmakebuiltins.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qmake') diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp index bb07ad44a3..f57d9c89a7 100644 --- a/qmake/library/qmakebuiltins.cpp +++ b/qmake/library/qmakebuiltins.cpp @@ -514,7 +514,7 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand( QString tmp = args.at(0).toQString(m_tmp1); for (int i = 1; i < args.count(); ++i) tmp = tmp.arg(args.at(i).toQString(m_tmp2)); - ret << ProString(tmp); + ret << (tmp.isSharedWith(m_tmp1) ? args.at(0) : ProString(tmp).setSource(args.at(0))); } break; case E_FORMAT_NUMBER: -- cgit v1.2.3 From b4e6409feadc5c0f33338df2ea824b28345561a0 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Fri, 7 Mar 2014 12:56:59 +0100 Subject: add ProFile::tokPtrEnd() just syncing up with qtcreator. Change-Id: I2bda6961f6f1164bdc58acd78fa3d2221977f0cf Reviewed-by: Oswald Buddenhagen (cherry picked from qtcreator/765ad6c3d28813d4baa0aeafd03076ba76557d3d) Reviewed-by: Joerg Bornemann --- qmake/library/proitems.h | 1 + 1 file changed, 1 insertion(+) (limited to 'qmake') diff --git a/qmake/library/proitems.h b/qmake/library/proitems.h index 9430d28521..e4ef1d1586 100644 --- a/qmake/library/proitems.h +++ b/qmake/library/proitems.h @@ -342,6 +342,7 @@ public: const QString &items() const { return m_proitems; } QString *itemsRef() { return &m_proitems; } const ushort *tokPtr() const { return (const ushort *)m_proitems.constData(); } + const ushort *tokPtrEnd() const { return (const ushort *)m_proitems.constData() + m_proitems.size(); } void ref() { m_refCount.ref(); } void deref() { if (!m_refCount.deref()) delete this; } -- cgit v1.2.3 From 193c6d2ebbac453f12c24def302f08f3b85e6d2a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 22 May 2014 15:21:36 +0200 Subject: avoid that a bad qmakespec path crashes the evaluator assigning a relative path to QMAKESPEC or QMAKESPEC_ORIGINAL (in the qt4 windows legacy code) would lead to an assert further down the line. just ignore such attempts silently. Task-number: QTCREATORBUG-8477 Change-Id: Ie53d0ef004c743284b85de4e89f112e0161ff4b7 Reviewed-by: Daniel Teske (cherry picked from qtcreator/e017a1dc8b2030e509d6198315e9f6a9869667e7) Reviewed-by: Joerg Bornemann --- qmake/library/qmakeevaluator.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'qmake') diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp index 73ea10daf8..efda9df7d4 100644 --- a/qmake/library/qmakeevaluator.cpp +++ b/qmake/library/qmakeevaluator.cpp @@ -912,8 +912,11 @@ void QMakeEvaluator::visitProVariable( m_featureRoots = 0; else if (varName == statics.strQMAKESPEC) { if (!values(varName).isEmpty()) { - m_qmakespec = values(varName).first().toQString(); - m_featureRoots = 0; + QString spec = values(varName).first().toQString(); + if (IoUtils::isAbsolutePath(spec)) { + m_qmakespec = spec; + m_featureRoots = 0; + } } } #ifdef PROEVALUATOR_FULL @@ -1159,8 +1162,11 @@ bool QMakeEvaluator::loadSpecInternal() // the source of the qmake.conf at the end of the default/qmake.conf in // the QMAKESPEC_ORIGINAL variable. const ProString &orig_spec = first(ProKey("QMAKESPEC_ORIGINAL")); - if (!orig_spec.isEmpty()) - m_qmakespec = orig_spec.toQString(); + if (!orig_spec.isEmpty()) { + QString spec = orig_spec.toQString(); + if (IoUtils::isAbsolutePath(spec)) + m_qmakespec = spec; + } # endif #endif valuesRef(ProKey("QMAKESPEC")) = ProString(m_qmakespec); -- cgit v1.2.3 From 7b1a8e047cd2823246568cabf9b604888b3e8bd9 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 26 Jun 2014 12:37:39 +0200 Subject: consider qt resource paths absolute this fixes an assertion failure with qt4 mingw specs when PATH contains a "." element. Task-number: QTCREATORBUG-12528 Change-Id: I2b6b7e02cf38881d40bd78bb0d705f7d58d0736c Reviewed-by: Christian Kandeler (cherry picked from qtcreator/d0428a05220ed0550dd84cdb8299a1fb37b0fe72) Reviewed-by: Christian Kandeler --- qmake/library/ioutils.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'qmake') diff --git a/qmake/library/ioutils.cpp b/qmake/library/ioutils.cpp index 04be215246..a2f3e8ec3d 100644 --- a/qmake/library/ioutils.cpp +++ b/qmake/library/ioutils.cpp @@ -68,6 +68,10 @@ bool IoUtils::isRelativePath(const QString &path) { if (path.startsWith(QLatin1Char('/'))) return false; +#ifdef QMAKE_BUILTIN_PRFS + if (path.startsWith(QLatin1String(":/"))) + return false; +#endif #ifdef Q_OS_WIN if (path.startsWith(QLatin1Char('\\'))) return false; -- cgit v1.2.3 From ba2d6bb968b1a3589fc4e1afe3fd7a6cb23f3622 Mon Sep 17 00:00:00 2001 From: hjk Date: Sat, 23 Aug 2014 01:19:53 +0200 Subject: Use Qt 5's QStringList::join(QChar) Less typing and less cycles than join(QString) where appropriate Change-Id: I6ebc0e17e4d7fd9845864dd95b7de4ba4dad6906 Reviewed-by: Eike Ziller (cherry picked from qtcreator/6431ab2c799553623ec3fe6a79f1e85484558dd6) Reviewed-by: Joerg Bornemann --- qmake/library/qmakeglobals.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'qmake') diff --git a/qmake/library/qmakeglobals.cpp b/qmake/library/qmakeglobals.cpp index 55ce404410..dd13b94d92 100644 --- a/qmake/library/qmakeglobals.cpp +++ b/qmake/library/qmakeglobals.cpp @@ -197,11 +197,11 @@ QMakeGlobals::ArgumentReturn QMakeGlobals::addCommandLineArguments( void QMakeGlobals::commitCommandLineArguments(QMakeCmdLineParserState &state) { if (!state.preconfigs.isEmpty()) - state.precmds << (fL1S("CONFIG += ") + state.preconfigs.join(fL1S(" "))); - precmds = state.precmds.join(fL1S("\n")); + state.precmds << (fL1S("CONFIG += ") + state.preconfigs.join(QLatin1Char(' '))); + precmds = state.precmds.join(QLatin1Char('\n')); if (!state.postconfigs.isEmpty()) - state.postcmds << (fL1S("CONFIG += ") + state.postconfigs.join(fL1S(" "))); - postcmds = state.postcmds.join(fL1S("\n")); + state.postcmds << (fL1S("CONFIG += ") + state.postconfigs.join(QLatin1Char(' '))); + postcmds = state.postcmds.join(QLatin1Char('\n')); if (xqmakespec.isEmpty()) xqmakespec = qmakespec; -- cgit v1.2.3 From b7205053ed696566072cf0e332de39b3c8ce22a8 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 29 Aug 2014 13:18:41 +0200 Subject: Remove Qt version checks. Qt 5.3 is the minimum requirement these days. Remove all fallback code from sources and project files. Change-Id: If6188a471197acadda4d6baee71804ba1a8026c6 Reviewed-by: Eike Ziller (cherry picked from qtcreator/847f10e9ccc8c3541782a790e04c85c6b4c701da) Reviewed-by: Joerg Bornemann --- qmake/library/proitems.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'qmake') diff --git a/qmake/library/proitems.cpp b/qmake/library/proitems.cpp index a610da6b69..5fb70df3b1 100644 --- a/qmake/library/proitems.cpp +++ b/qmake/library/proitems.cpp @@ -212,11 +212,7 @@ ProString &ProString::prepend(const ProString &other) ProString &ProString::append(const QLatin1String other) { const char *latin1 = other.latin1(); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) int size = other.size(); -#else - int size = strlen(latin1); -#endif if (size) { QChar *ptr = prepareExtend(size, 0, m_length); for (int i = 0; i < size; i++) -- cgit v1.2.3 From 99a4a62977347654bee77513661df538c9ee4ab3 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Tue, 9 Sep 2014 15:16:27 +0200 Subject: QMakeGlobals::expandEnvVars: Make sane Use indexOf() to match individual characters, which is a lot faster than QRegExp. As a side effect, don't try to expand what we just inserted. Change-Id: I964fbd92055f2f2649e7d8ed5739cf1fc7cae927 Reviewed-by: Oswald Buddenhagen Reviewed-by: Daniel Teske (cherry picked from qtcreator/2cc17a61eb6d0fee80fd388fcc5be03a59e4f2b5) Reviewed-by: Joerg Bornemann --- qmake/library/qmakeglobals.cpp | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) (limited to 'qmake') diff --git a/qmake/library/qmakeglobals.cpp b/qmake/library/qmakeglobals.cpp index dd13b94d92..8bb5199519 100644 --- a/qmake/library/qmakeglobals.cpp +++ b/qmake/library/qmakeglobals.cpp @@ -74,27 +74,8 @@ QT_BEGIN_NAMESPACE #define fL1S(s) QString::fromLatin1(s) -namespace { // MSVC doesn't seem to know the semantics of "static" ... - -static struct { - QRegExp reg_variableName; -} statics; - -} - -static void initStatics() -{ - if (!statics.reg_variableName.isEmpty()) - return; - - statics.reg_variableName.setPattern(QLatin1String("\\$\\(.*\\)")); - statics.reg_variableName.setMinimal(true); -} - QMakeGlobals::QMakeGlobals() { - initStatics(); - do_cache = true; #ifdef PROEVALUATOR_DEBUG @@ -292,11 +273,24 @@ QStringList QMakeGlobals::getPathListEnv(const QString &var) const QString QMakeGlobals::expandEnvVars(const QString &str) const { QString string = str; - int rep; - QRegExp reg_variableName = statics.reg_variableName; // Copy for thread safety - while ((rep = reg_variableName.indexIn(string)) != -1) - string.replace(rep, reg_variableName.matchedLength(), - getEnv(string.mid(rep + 2, reg_variableName.matchedLength() - 3))); + int startIndex = 0; + forever { + startIndex = string.indexOf(QLatin1Char('$'), startIndex); + if (startIndex < 0) + break; + if (string.length() < startIndex + 3) + break; + if (string.at(startIndex + 1) != QLatin1Char('(')) { + startIndex++; + continue; + } + int endIndex = string.indexOf(QLatin1Char(')'), startIndex + 2); + if (endIndex < 0) + break; + QString value = getEnv(string.mid(startIndex + 2, endIndex - startIndex - 2)); + string.replace(startIndex, endIndex - startIndex + 1, value); + startIndex += value.length(); + } return string; } -- cgit v1.2.3 From 33486e0ae7d40045029f9e24bebdf7a6829f756c Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 24 Oct 2014 10:28:28 +0200 Subject: Use QFileInfo::exist(f) instead of QFileInfo(f).exists() if possible Faster. Change-Id: I91aa67462e11ff3258600d7f158de79942d0dc81 Reviewed-by: Marc Reilly Reviewed-by: Christian Stenger (cherry picked from qtcreator/a439483d704113286370e7e93e0e6bc16199d8ab) Reviewed-by: Joerg Bornemann --- qmake/library/qmakeevaluator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qmake') diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp index efda9df7d4..e220d59517 100644 --- a/qmake/library/qmakeevaluator.cpp +++ b/qmake/library/qmakeevaluator.cpp @@ -1921,7 +1921,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFeatureFile( } #ifdef QMAKE_BUILTIN_PRFS fn.prepend(QLatin1String(":/qmake/features/")); - if (QFileInfo(fn).exists()) + if (QFileInfo::exists(fn)) goto cool; #endif fn = QLatin1String(""); // Indicate failed lookup. See comment above. -- cgit v1.2.3 From c66b492cedbd96831e02269aa65d38b8a4b55df0 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 27 Oct 2015 15:13:34 +0100 Subject: fix vcxproj linker options Commit 4bb004de94380304d8950e860d1823975927ec59 broke the linker options in generated Visual Studio projects. We need to call fixLibFlags on QMAKE_LIBS and QMAKE_LIBS_PRIVATE. Task-number: QTBUG-48936 Change-Id: I2f12bf0117d27104cd34f2f43fdeb7b948fa375e Reviewed-by: Oswald Buddenhagen --- qmake/generators/win32/msvc_vcproj.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index b1e0745e03..47f99a5c8e 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -1207,12 +1207,13 @@ void VcprojGenerator::initLinkerTool() if (!project->values("DEF_FILE").isEmpty()) conf.linker.ModuleDefinitionFile = project->first("DEF_FILE").toQString(); - foreach (const ProString &libs, project->values("QMAKE_LIBS") + project->values("QMAKE_LIBS_PRIVATE")) { - if (libs.left(9).toQString().toUpper() == "/LIBPATH:") { - ProStringList l = ProStringList(libs); - conf.linker.parseOptions(l); - } else { - conf.linker.AdditionalDependencies << escapeFilePath(libs.toQString()); + static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 }; + for (int i = 0; lflags[i]; i++) { + foreach (const ProString &lib, fixLibFlags(lflags[i])) { + if (lib.startsWith("/LIBPATH:")) + conf.linker.AdditionalLibraryDirectories << lib.mid(9).toQString(); + else + conf.linker.AdditionalDependencies << lib.toQString(); } } -- cgit v1.2.3 From 1c01cfa07734a299ed5f4c3489b140009a7cad45 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Tue, 3 Nov 2015 12:59:29 +0100 Subject: Doc: corrected error about path list separator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-48673 Change-Id: Id5b99c0dd778b55c937d345e49995086c5ef372e Reviewed-by: Oswald Buddenhagen Reviewed-by: Martin Smith Reviewed-by: Topi Reiniƶ --- qmake/doc/src/qmake-manual.qdoc | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'qmake') diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc index 535b500fd3..6915c2e5c1 100644 --- a/qmake/doc/src/qmake-manual.qdoc +++ b/qmake/doc/src/qmake-manual.qdoc @@ -3965,25 +3965,27 @@ \list 1 \li In a directory listed in the \c QMAKEFEATURES environment variable that - contains a colon-separated list of directories. + contains a list of directories delimited by the platform's path list separator + (colon for Unix, semicolon for Windows). \li In a directory listed in the \c QMAKEFEATURES property variable that - contains a colon-spearated list of directories. + contains a list of directories delimited by the platform's path list separator. \omit \li In a features directory beneath the project's root directory (where - the \c{.qmake.cache} file is generated). + the \c{.qmake.cache} file is generated). \endomit \li In a features directory residing within a \c mkspecs directory. - \c mkspecs directories can be located beneath any of the directories - listed in the \c QMAKEPATH environment variable that contains a - colon-separated list of directories. For example: + \c mkspecs directories can be located beneath any of the directories + listed in the \c QMAKEPATH environment variable that contains a + list of directories delimited by the platform's path list separator. + For example: \c{$QMAKEPATH/mkspecs/}. \li In a features directory residing beneath the directory provided by the - \l{QMAKESPEC} environment variable. For example: \c{$QMAKESPEC/}. + \l{QMAKESPEC} environment variable. For example: \c{$QMAKESPEC/}. \li In a features directory residing in the \c data_install/mkspecs directory. - For example: \c{data_install/mkspecs/}. + For example: \c{data_install/mkspecs/}. \li In a features directory that exists as a sibling of the directory - specified by the \c QMAKESPEC environment variable. - For example: \c{$QMAKESPEC/../}. + specified by the \c QMAKESPEC environment variable. + For example: \c{$QMAKESPEC/../}. \endlist The following features directories are searched for features files: -- cgit v1.2.3