summaryrefslogtreecommitdiffstats
path: root/qmake/library/qmakebuiltins.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-06-211-1/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qsysinfo.h src/corelib/kernel/qcoreapplication_win.cpp src/gui/text/qdistancefield.cpp src/gui/text/qdistancefield_p.h src/plugins/platforms/windows/qwindowsglcontext.cpp src/plugins/platforms/windows/qwindowsglcontext.h Change-Id: Ib3500acc2b28553bde06758cd9a2e19eb7fe2978
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-201-1/+6
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And blacklisted a few tests in tst_QUdpSocket. Conflicts: src/android/jar/src/org/qtproject/qt5/android/QtNative.java src/corelib/global/qglobal.cpp src/corelib/global/qsystemdetection.h src/corelib/io/qfileselector.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp tests/auto/network/socket/qudpsocket/BLACKLIST Task-number: QTBUG-54205 Change-Id: I11dd1c90186eb1b847d45be87a26041f61d89ef6
| | * qmake: Fix missing newlines in generated vcxproj filesMat Sutcliffe2016-06-161-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A bug in the Windows C Runtime causes text mode pipes to drop newlines sometimes. This bug was hidden because of another bug in rcc which caused newlines to be redundantly duplicated. When the latter bug was fixed (commit 53d5811b) the former bug was exposed, causing invalid vcxproj files to be generated. The Windows bug is described here: https://connect.microsoft.com/VisualStudio/feedback/details/1902345 The workaround is to avoid text mode, and do the conversion of "\r\n" to "\n" ourselves (which we were already doing anyway). Change-Id: I792599a4cd7822f109fa921f02207fb1b144b1d1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | | Improve error reporting when parsing JSON filesLars Knoll2016-06-171-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | At least report the error string and the file offset where the error happened. Change-Id: Iaa1733593b8af2a7a52b67c0f495731f045d2c11 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | | add $$sorted() function.Oswald Buddenhagen2016-05-251-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][qmake] Added $$sorted() function. Change-Id: Ic069d3ef7c0b7a260c714c76eecc71c41417d01f Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
* | | add $$str_member() functionOswald Buddenhagen2016-05-251-37/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | just like $$member(), but operates on a string value rather than a list variable. it is the swiss army knife of cutting, providing equivalents of left(), right(), mid() and reverse() all in one. [ChangeLog][qmake] Added $$str_member() function. Change-Id: I7c7c6c971db402fff41b428d32a4451f45400728 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | add $$str_size() functionOswald Buddenhagen2016-05-251-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this is strlen(), but the name is matched to $$size(), just namespaced to reflect that it operates on a string value rather than a list variable. [ChangeLog][qmake] Added $$str_size() function. Change-Id: I56c8b863da244e66bd283257a66b197aa73b0e57 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | add $$num_add() (numeric addition) functionOswald Buddenhagen2016-05-251-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | amazing how we managed to do without it for so long. ^^ the name is intentionally somewhat obscure to avoid clashes, and some namespacing is good anyway. [ChangeLog][qmake] Added $$num_add() function. Change-Id: Ib7648b1f425ef096a87b51f158d0f1409e5c4daa Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | | add $$take_first() and $$take_last() functionsOswald Buddenhagen2016-05-251-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | while implementing stacks and queues was possible before with the help of $$member(), these functions make it much more straight-forward. [ChangeLog][qmake] Added $$take_first() and $$take_last() functions. Change-Id: I4922a5331780e468a42c663c9ad3c6456a95a6bf Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | remove remaining pointless conversions to QStringOswald Buddenhagen2016-05-241-27/+24
| | | | | | | | | | | | | | | | | | | | | | | | we have perfectly good overloads which work with ProString itself, or at least with QStringRef. Change-Id: I45f39b8c2f83216f20849dd58eb3b8d78726083d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | | make split_value_list() take a QStringRef as inputOswald Buddenhagen2016-05-241-8/+10
| | | | | | | | | | | | | | | | | | | | | this also saves some of the cheap but ugly toQString() calls. Change-Id: Iebe644986501db3878306521c76e4ba2c2fb97b4 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | | make QMakeParser take a QStringRef as inputOswald Buddenhagen2016-05-241-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the only place where this actually saves a deep copy is the evaluation of if(), but as a side effect the parser is now able to deal with not null-terminated strings, which is kinda nice as well. Change-Id: Ib6d08617aa79d2f9eaecd4906d4d548f34bf377d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | | make QMakeEvaluator::isActiveConfig() take a QStringRef argumentOswald Buddenhagen2016-05-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | saves some more cheap but pointless conversions to QString. this makes the introduction of the ProStringList::contains(QStringRef) overload necessary. Change-Id: Ic61993bd9a4b28fbba1b8e346345fd5f5636c6f0 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | | add ProStringList::join(ProString) overload and make use of itOswald Buddenhagen2016-05-241-3/+2
|/ / | | | | | | | | | | | | | | this introduces an ambiguity, so some char* arguments need explicit QString construction now. Change-Id: Ic3919a1fa9419bbb3b57dd1aa7eb95643ee59e53 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | add ProString::toLongLong() and make use of itOswald Buddenhagen2016-05-191-1/+1
| | | | | | | | | | | | | | this is just a bit cleaner. Change-Id: I03e628aca9e2e53c602a4db724da277a0e2c2486 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | remove pointless conversion to QString in isTrue()Oswald Buddenhagen2016-05-191-5/+4
| | | | | | | | | | Change-Id: I7766672018dd4acf9b9fb89acfe664671de4bc3d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | remove pointless conversions to QString when converting to intOswald Buddenhagen2016-05-191-6/+6
| | | | | | | | | | | | | | this doesn't change a lot, but is cleaner. Change-Id: Ia89c399d6df7cc6264954cf309d2c971a5592d6b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | qmake: de-duplicate QString::number() calls with same argAnton Kudryavtsev2016-02-081-2/+3
| | | | | | | | | | Change-Id: I6e05b9ad3350bd0da5b8a6dc1389ae05315a33df Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | qmake: optimize container usage in the json handling.Anton Kudryavtsev2016-02-041-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Iterate only once over QJsonObject, create key list by existing loop instead of create by QJsonObject::keys(), which contains internal loop. In common case if loop's statement is lightweight, then effect of optimization is significant, and vice versa. Also make addJsonArray() and addJsonObject() functions more homogeneous. Use reserve to optimize memory allocation. Change-Id: Id122cd1becfd34bb06640876b1c79e1d396d2a6b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | qmake: use reserve to optimize memory allocation.Anton Kudryavtsev2016-02-011-0/+2
| | | | | | | | | | Change-Id: I6ace338512c24fd9dc11c767a28f0a63454076fa Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | qmake: eradicate Q_FOREACH loops [already const]Marc Mutz2016-01-281-6/+6
| | | | | | | | | | | | | | | | (or trivially marked const) ... by replacing them with C++11 range-for loops. Change-Id: I1522e220a57ecb1c5ee0d4281233b3c3931a2ff8 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | qmake: eradicate Q_FOREACH loops [needing qAsConst()]Marc Mutz2016-01-281-4/+4
| | | | | | | | | | | | | | | | | | ... by replacing them with C++11 range-for loops. To avoid detaches of these mutable Qt containers, wrap the container in qAsConst(). Change-Id: If086bea06fe26232a7bb99fad8b09fce4dc74c27 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | qmake: eradicate Q_FOREACH loops [rvalues]Marc Mutz2016-01-281-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | ... by replacing them with C++11 range-for loops. This is the simplest of the patch series: Q_FOREACH took a copy, so we do, too. Except we don't, since we're just catching the return value that comes out of the function (RVO). We can't feed the rvalues into range-for, because they are non-const and would thus detach. Change-Id: I5834620bf82f3442da7b2838363d351a0fb960a0 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | qmake: don't iterate over .keys()Marc Mutz2016-01-281-2/+2
| | | | | | | | | | | | | | | | | | ... iterate over the container itself instead. Avoids temporary QList creation as well as the lookup cost when actually calling value(key). Change-Id: Icac867c30e63863cfa44a382eedd4d6df2070a59 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-211-17/+12
|/ | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* add enablers for printing project errors in cumulative modeOswald Buddenhagen2015-12-211-2/+6
| | | | | | | | | | this doesn't actually do anything in qmake. Change-Id: Ia14953a5a9dc31af56ad6c338017dd5b85bb4494 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> (cherry picked from qttools/08d0cb6f8e90a818bf6d3bec7a6d00f16419b8c0) Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* make write_file() capable of making files (not) executableOswald Buddenhagen2015-12-211-8/+19
| | | | | Change-Id: I9ca96bc3408160261781697a3471c1f446c86c3a Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* fix raw data leak in $$sprintf()Oswald Buddenhagen2015-10-271-1/+1
| | | | | | | | | | 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 <daniel.teske@digia.com> (cherry picked from qtcreator/cdc2a0f72334268684e0407e9b04b3188e00d4bf) Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* micro-optimization: use ProStringList::join(QChar) overloadOswald Buddenhagen2015-10-271-1/+1
| | | | | | | Change-Id: I25c6205df78da7fbee0ad1b04476f528f376b7a6 Reviewed-by: Daniel Teske <daniel.teske@digia.com> (cherry picked from qtcreator/701a82d3a2185702c09dfecb361853fc18947807) Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* QmakeParser: Do not leak temporaries into cache of filesTobias Hunger2015-10-271-1/+3
| | | | | | | | | | | | | | 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 <oswald.buddenhagen@digia.com> (cherry picked from qtcreator/336c3159617cdb3edd35021b5fb312d4d43f9a84) Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* don't complain about missing include()s during cumulative evaluationOswald Buddenhagen2015-10-271-0/+2
| | | | | | | | | it produces simply too many false positives. Change-Id: I3dfa109866450babe5c16f84665ad22024d99e42 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> (cherry picked from qttools/08bae158320f6d73bf44fcf43f45f51a01334544) Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* remove bogus parens from error messagesOswald Buddenhagen2015-05-201-2/+2
| | | | | Change-Id: I2683a4fb19a7251dc537e3265db3ba28079eb4b8 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* trim whitespace from windows error messagesOswald Buddenhagen2015-05-201-1/+1
| | | | | | | the messages contain a trailing CRLF, which is not helpful. Change-Id: I4a27115a191dc416a62e28a41f2a9c5893bdc64b Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* remove trailing dots from some error messagesOswald Buddenhagen2015-05-201-3/+3
| | | | | | | | the i/o functions are not very consistent about having the dot already in the message. the windows api does, and qt passes this on. Change-Id: I2d1a213965e15478985d6eff205689ea44aa2a03 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* make defined() error message tell about "var" typeOswald Buddenhagen2015-05-201-1/+1
| | | | | Change-Id: I21d994ebaee2db0d9b114812a8f89bb680ca311e Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* move some functions into ProStringList for saner OO designOswald Buddenhagen2015-02-121-1/+1
| | | | | Change-Id: I60f00f38f459fc9f8eebee9187158e4198fc9546 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* make quoting in the prl writer more robustOswald Buddenhagen2015-02-051-2/+2
| | | | | Change-Id: Idd9f64ac608b7e4ed840d5d9925bf741e03d78ab Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* remove pointless return value from QMakeParser::read()Oswald Buddenhagen2015-02-041-8/+6
| | | | | | | | | | it always returned true nowadays. an obvious followup effect is that the return value of parsedProBlock() doesn't need to be null-checked any more as well. Change-Id: I782785cab9b721a78a342a010921a73e642ebe7f Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* add priority sorting to $$resolve_depends()Oswald Buddenhagen2014-07-301-12/+17
| | | | | | | | all else being equal, items with a higher numerical priority will appear first in the result. Change-Id: I4ee37ff404a53c4152a1e4fc2fc3c23ef525234d Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* qmake: Use QDir::toNativeSeparators on paths printed as infoAlessandro Portale2014-05-081-3/+3
| | | | | Change-Id: I8c587164bcff742f7ac8ad3f3f28e0b16645cb2a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* fix $$shell_path() for mingw+shOswald Buddenhagen2014-04-301-2/+10
| | | | | | | | the msys shell expects unix-like paths with drives converted from d:\ to /d/. Change-Id: I09e25ed2c868702e5d7d8b9cc8c04cc13410eeff Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* de-duplicate codeOswald Buddenhagen2014-04-041-3/+3
| | | | | Change-Id: Ic056acf739659215241c1cab6a462b1ab591dc78 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* qmake: add replacement function getenvJoerg Bornemann2014-03-201-1/+11
| | | | | | | | | This is useful for querying environment variables which have parentheses in their name. Such jewels exist on Windows. The usual $$(VARNAME) syntax fails for those. Change-Id: I1d2766cabdc7f637caa9ae6408967685e02f5029 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* support a cache that is really just a cacheOswald Buddenhagen2013-11-141-21/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | unlike .qmake.cache & co., the presence of this file has no magic effects on where mkspecs, modules and other things are searched. as the obvious name "cache" is of course already taken, we call it "stash". the file is searched up to the super cache (if present), otherwise up to the normal cache/conf (if present), otherwise up to the root. if it's not found, it is created next to the super cache (if present), otherwise next to the cache/conf (if present), otherwise in the current output directory. note that the cache really should be created and populated by the top-level project if there are subprojects: otherwise, if there is an "anchor" (super/cache/conf), subprojects would race for updating the cache and make a mess. without an "anchor", each subproject would just create its own cache, kind of defeating its purpose. this is no different from the existing "cache", but it's worth mentioning that removing the "anchoring" function does not remove the "nesting order" constraint. Task-number: QTBUG-31340 Change-Id: I786d40cef40d14582a0dd4a9407863001bec4c98 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* clean superfile and cachefile paths upon creationOswald Buddenhagen2013-11-141-2/+2
| | | | | | | | | otherwise, if the output dir is the root, the path would be denormalized. the code for finding existing files already does that. Change-Id: I56d70477e9c9ffcd936325068624a84df10ffd87 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Add JSON parsing support to qmake.Morten Johan Sørvig2013-10-171-1/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add qjson* implementation files from corelib/json to the qmake build. Add a read-only compile mode, enabled by defining QT_JSON_READONLY. Add qmake built-in function parseJson(file, into) which parses a json file into the given variable. qmake uses a flat key -> value-list implementation for storing variables, which means that some hackery is need to represent arbitrarily nested JSON. Use a special "_KEYS_" variable for arrays and objects: Arrays: ["item1", "item2"] $${array._KEYS_} -> 0 1 2 $${array.0} -> "item1" $${array.1} -> "item2" Objects: { "key1" : "value1", "key2" : "value2" } $${object._KEYS_} -> key1 key2 $${object.key1} -> value1 $${object.key2} -> value2 Change-Id: I0aa2e4e4ae14fa25be8242bc16d3cffce32504d2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* qmake: add $$title() function to convert strings to title caseTor Arne Vestbø2013-09-241-2/+10
| | | | | Change-Id: Ic535a8f7cc2ab7b7f1948b2d0237ebe9a71c7ec7 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* avoid deadlock in cache() during spec/cache loadingOswald Buddenhagen2013-08-271-1/+1
| | | | | | | | | | | | | sync up; this doesn't actually do anything in qmake. if we end up calling cache() from within the initialization of the base context, we cannot wait for for the completion of that initialization before we proceed, obviously. Change-Id: If30c6f3665fe423e767373a8821c406b2f5e0eca Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Daniel Teske <daniel.teske@digia.com> (cherry picked from qtcreator/b64b4431c20afd9e39c1463e736f998ef450688f)