Commit Graph

90 Commits

Author SHA1 Message Date
Oswald Buddenhagen
87eb3ea190 work around MSVC2010 ICE
Task-number: QTBUG-42064
Change-Id: Ifffcc0cf9109b76d79f603a13792d7fd9979761c
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2014-10-29 09:37:17 +01:00
Matti Paaso
974c210835 Update license headers and add new license files
- Renamed LICENSE.LGPL to LICENSE.LGPLv21
- Added LICENSE.LGPLv3
- Removed LICENSE.GPL

Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
2014-09-24 12:26:19 +02:00
Thiago Macieira
c1be0fbe7d Fix compilation after qstringlist.h stopped including qdatastream.h
Change-Id: Ida09e794262dce78cd5169aac56b610fabc9082c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-08-08 10:44:59 +02:00
Oswald Buddenhagen
26bbc40db9 add priority sorting to $$resolve_depends()
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>
2014-07-30 10:31:53 +02:00
Oswald Buddenhagen
11161bbfad pass a pointer instead of a reference to initFrom()
msvc thinks that it's impossible to create a null reference (because
some language lawyer said so) and thus complains about our assert that
checks the reference's validity. work around by not dereferencing the
pointers we already have.

Change-Id: Ife2288d4187860105de12fdebc0e671e0159ace3
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-06-20 11:47:19 +02:00
Alessandro Portale
01ce104a3e qmake: Use QDir::toNativeSeparators on paths printed as info
Change-Id: I8c587164bcff742f7ac8ad3f3f28e0b16645cb2a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-05-08 16:37:59 +02:00
Oswald Buddenhagen
d52b00e1d3 fix $$shell_path() for mingw+sh
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>
2014-04-30 16:57:09 +02:00
Oswald Buddenhagen
fb143abbfb de-duplicate code
Change-Id: Ic056acf739659215241c1cab6a462b1ab591dc78
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-04-04 19:32:21 +02:00
Joerg Bornemann
b73d6be6a0 qmake: add replacement function getenv
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>
2014-03-20 08:35:24 +01:00
Oswald Buddenhagen
ee35954122 don't turn = into += in cumulative mode
it leads to pathological cases where the number of loop iterations may
go way beyond the reasonable.

this means that users need to avoid using the = operator in alternative
branches that lead to different sources/subdirectories being included
into the project. this is a bit of a corner case anyway, as people
usually add directly to SOURCES/SUBDIRS.

Task-number: QTCREATORBUG-1595
Change-Id: I7783e318fbc2790f6a853ba4e3f4a12db881feb5
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
(cherry picked from qtcreator/30bd7fcce1aef974f6af9eaa6532aa1f2b6192d2)
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-01-15 21:32:41 +01:00
Oswald Buddenhagen
ca02462f02 set QMAKE_INTERNAL_INCLUDED_FILES even without PROEVALUATOR_FULL
some qt prfs use this variable, so better set it it to avoid some noise.

Change-Id: I606c88dd7664b1cd8b490d60badd5c6bf80fd1c9
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
(cherry picked from qtcreator/e64cc71194cbe283dfe9bd2cd688f01fcdcadf34)
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-01-15 21:32:41 +01:00
Oswald Buddenhagen
65a676372c do not look for mkspecs/ directories in project trees
this pretty surprising behavior would interfere with building the
examples from an installed qt tree with qmakes from other qt builds.

.qmake.conf (and .qmake.cache) files provide a possibility to explicitly
"anchor" project roots, so there is no point in having a second, even
more magic way to do it.

Task-number: QTBUG-35485
Change-Id: I8fd4fda67cabafdf55e7a98282dcdfaffb4a405e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-01-07 19:46:16 +01:00
Oswald Buddenhagen
ff31d87cc8 support a cache that is really just a cache
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>
2013-11-14 19:26:20 +01:00
Oswald Buddenhagen
72075656cf clean superfile and cachefile paths upon creation
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>
2013-11-14 19:26:20 +01:00
Oswald Buddenhagen
0f68222e9e move setting of _QMAKE_{SUPER,CONF,CACHE}_ to a more logical location
there is no point in setting the variables already when peeking into
the caches, as that is done in a separate evaluator anyway.
it also makes no sense to have them set while loading the spec itself,
as it's not permitted to do anything with the caches.
so set them at the next convenient point, which is right before actually
loading the caches.

Change-Id: I3717ddf94353dc04e12c52e542f16ed27b578e14
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-11-04 19:50:10 +01:00
Tor Arne Vestbø
1cdbe4752b qmake: Expose qmake arguments as QMAKE_ARGS
Allows project files or mkspecs to call qmake recursively using system()
with the right arguments, which we use to fix the ios default_post.prf.

Change-Id: I90d69e2b156bb0f0af1279188b11f81c84c24fb8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-10-24 20:20:59 +02:00
Morten Johan Sørvig
89ef515177 Add JSON parsing support to qmake.
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>
2013-10-17 08:07:25 +02:00
Tor Arne Vestbø
a9bad65b09 qmake: Update internal mkspec on changes to QMAKESPEC
Allows the macx-xcode mkspec to be a wrapper around other mkspecs.

Since QMAKESPEC can now be set in the spec, we have to ensure not
to append to QMAKESPEC.

Change-Id: Idf33ff38147f14c488f14b426c02d9a739fdaecf
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-10-11 21:01:27 +02:00
Tor Arne Vestbø
eea1c359c9 qmake: Evaluate extra configs before loading default_pre
Exclusive builds uses setExtraConfigs to apply the particular CONFIG
of each build pass. Unfortunately we were not applying these extra
configs early enough in QMakeEvaluator::visitProFile() for them to
be picked up/usable by default_pre, something that can be useful.

Change-Id: I423a4688250a15f0c1a2cc65a48f0bbc14ad4497
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-10-11 18:47:27 +02:00
Tor Arne Vestbø
8e7dc25380 qmake: Load extra variables only if also loading pre-files
The extra variables only need to be applied once, when we
are loading the pro file (and hence are loding pre files),
not for every single pri/prf that's loaded as a result of that
(which do not load pre files themselves).

Change-Id: I3118694a8eeccf2dc32c4f62df754033fad13528
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-10-11 18:47:27 +02:00
Oswald Buddenhagen
50a90720be make setting a bad $$[QMAKEFEATURES] not crash qmake
Task-number: QTBUG-29642
Change-Id: I9cc209eb313f03bf342bcb64b1de3005755700a7
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-10-07 21:01:31 +02:00
Tor Arne Vestbø
413ec67fc4 qmake: add $$title() function to convert strings to title case
Change-Id: Ic535a8f7cc2ab7b7f1948b2d0237ebe9a71c7ec7
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-09-24 14:33:00 +02:00
Tor Arne Vestbø
09205d5734 qmake: Expose ARGC to qmake functions to be able to check argument count
ARGS already exists, but is a flattened list of the arguments, so both
foo(bar, baz) and foo(bar baz) will give count(ARGS, 2), making it
unreliable for validating arguments to qmake functions.

Change-Id: I0bcc16614c64000169431327da48fd1a26708e67
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-09-21 01:25:19 +02:00
Oswald Buddenhagen
e0f2603f49 avoid deadlock in cache() during spec/cache loading
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)
2013-08-27 13:36:34 +02:00
Oswald Buddenhagen
652bdb8894 lock baseEnv in cache()
sync up; this doesn't actually do anything in qmake.

as we modify the environment, it must be properly locked.
this implies that initFrom() also needs to be called with a lock.

Task-number: QTCREATORBUG-9835
Change-Id: I48bae9af9adaa0518e5a9db0ba08ff057ae14f9f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qtcreator/d022a2d19cecb00397c2a215fc4e3bf64b1e627b)
2013-08-27 13:36:31 +02:00
Oswald Buddenhagen
957134dc84 always check for baseEnv init failure
sync up; this doesn't actually do anything in qmake.

creator's file watcher can trigger many parallel, entirely
non-hierarchical project reloads. if there is enough of them to exceed
the thread pool size, some will be serialized already by qtconcurrent,
not by our wait condition. these should notice a faulty spec, too.

Change-Id: I8ce40cb90fbc28045127881d57ec94e125df79af
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qtcreator/759d0a69dd3973b4785b6f9412f46666a05cdf85)
2013-08-27 13:36:28 +02:00
Oswald Buddenhagen
b4c0d9166e change reporting of missing files
use the new parser flags to report all i/o errors directly.

as a notable side effect, the "WARNING" prefix is gone (even though
it is still treated like that, which is mildly insane to start with).

Change-Id: I084375d5e7a3314ae763795f7c318804a9fb84b6
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-08-20 22:56:12 +02:00
Oswald Buddenhagen
15981b985f complain about absent files to -pro argument (in lupdate)
this doesn't actually do anything in qmake.

Change-Id: I908fc3792bdc321370e51be98adf7a9c81e37a85
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qttools/e1f3732197ef77a29cb7f3c1ce094b3f31a7b689)
(cherry picked from qttools/226f013441990aa4a58f7c82e284057cff659959)
2013-08-20 22:56:07 +02:00
Oswald Buddenhagen
0a1faaa9eb avoid boolean argument trap: introduce QMakeParser::ParseFlag
Change-Id: I26ce032a1aa044e9a4da0c8708a4490b07374992
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qttools/066b08fc62c67d586996ea4e272ef05dd3865fac)
(cherry picked from qttools/226f013441990aa4a58f7c82e284057cff659959)
2013-08-20 22:55:59 +02:00
Oswald Buddenhagen
b215176da3 implement simple VFS to support caching during project parsing
sync up with qt creator - for qmake itself, this is just a minor
refactoring.

Change-Id: I833253f81c3159056fab2ff888f293b36cc2ef56
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
(cherry picked from qtcreator/66802ef8bf7989dc025e34bf91d93576189c483c)
(cherry picked from qtcreator/69542826fa643a0fed2fc9e717f072c2852dc017)
(cherry picked from qtcreator/196424115338fb9a535810704b7d814d318b0462)
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-08-07 13:58:41 +02:00
Oswald Buddenhagen
3fdf69b599 update m_featureRoots less aggressively
it's not necessary to immediately re-calculate the roots after assigning
QMAKE_PLATFORM - it's sufficient to do it on-demand, so merely
invalidate them. this avoids that we re-calculate them multiple times
without ever using them in between while processing specs with
distributed platform assignments.

Change-Id: If508594764811b96a577fc81c5ded34ab0453148
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
(cherry picked from qtcreator/28df27d924bb407791a76de8159c9ffa6efde283)
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-07-19 17:15:16 +02:00
Oswald Buddenhagen
3a6a462ad9 cache results of feature search
looking up the same files in the same locations over and over again
is a rather significant waste. in particular, looking up the CONFIG
flags that don't correspond with features has a measurable impact on qt
creator's project loading time.

Task-number: QTCREATORBUG-9154
Change-Id: Ibae3d8b7797e706a6416a7d45c77734ab1281b51
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
(cherry picked from qtcreator/fa27cd79e05aed4ebd16d5648480cc7d48fefd43)
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-07-19 17:15:16 +02:00
Oswald Buddenhagen
547b7ed29c minor optimization: don't concatenate strings needlessly
Change-Id: Iddec1a818ff9f3ad8b12491100883e433e4b8246
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
(cherry picked from qtcreator/12652c20711fd29dcba62b8d5ba71c077d8bd06c)
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-07-19 17:15:16 +02:00
Oswald Buddenhagen
4b600bd3c1 don't unnecessarily use QFileInfo::filePath()
just directly use the filename we constructed it from.

Change-Id: Ia428a2cb4b192fea6bde62dfbf35361bcfc4b21e
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
(cherry picked from qtcreator/571234786a3ff7e8e3a9220f12d22a9f74f7a53c)
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-07-19 17:15:16 +02:00
Sergio Ahumada
3ef6cf060e Merge branch 'stable' into dev
Conflicts:
	qmake/generators/mac/pbuilder_pbx.cpp
	src/corelib/json/qjsonwriter.cpp
	src/corelib/kernel/qeventdispatcher_blackberry.cpp
	src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm

Change-Id: I24df576c4cbd18fa51b03122f71e32bb83b9028f
2013-07-11 16:42:01 +02:00
Oswald Buddenhagen
b30273ec4a don't crash if builddir is suffix of sourcedir (or vice-versa)
Task-number: QTBUG-32145
Change-Id: I97a6e2ebd51350cbf39c86efa5c26a376c49da95
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-07-04 18:13:01 +02:00
Oswald Buddenhagen
783181cfc1 make split_value_list() even less sane again
contrary to what one may expect, it's actually *not* supposed to remove
the meta-characters it interprets.

luckily, this function is not used much any more ...

Task-number: QTBUG-31877
Change-Id: I2b60f9b173140da78db2b07b596cc2e5f6e6d555
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-07-03 21:38:37 +02:00
Frederik Gladhorn
572200989b Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	configure
	mkspecs/features/create_cmake.prf

Change-Id: I94aea83b83833395d5db399209e0e51b92ef23b5
2013-06-27 13:06:38 +02:00
Frederik Gladhorn
851fae6dbe Merge "Merge remote-tracking branch 'origin/release' into stable" into refs/staging/stable 2013-06-25 14:31:00 +02:00
Chris Stylianou
e97c37a37a Fix incorrect uname usage.
The POSIX function uname() can return any non-negative value for success.
- Example: Solaris 10 returns 1 on success.
See: http://pubs.opengroup.org/onlinepubs/009695399/functions/uname.html

Change-Id: Ic3d51f94a31d8b562b28a2d09df3d31b04c77dc8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-06-21 22:03:48 +02:00
Oswald Buddenhagen
d135a311a3 make Makefiles not depend on .qmake.super
this avoids that an empty rebuild after a complete build re-runs qmake
everywhere again.

according to 1f83f0cf2a this is the behavior i originally intended,
but somehow it got lost when switching to the new interpreter.

Change-Id: Id5158d7e272fdee4f4a041fb7c828295a0a86684
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-06-15 21:39:40 +02:00
Oswald Buddenhagen
0d463c05fc don't copy mkspecs to build directory
instead, teach qmake to use the mkspecs dir from the source dir as well.

Change-Id: I9edac11f8997fcb0594d0a67419d4733dd4ed86b
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-06-12 16:27:24 +02:00
Oswald Buddenhagen
d795e9ff5f introduce /src qmake property variants
this is for shadow builds during build time, where the respective files
are expected in the source dir.

Change-Id: I18dcfbdef99e1562a51dacac333642cae8105ebd
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-06-12 16:27:21 +02:00
Oswald Buddenhagen
40880ed440 remove pointless string conversion
Change-Id: I1640083007ed0c428dfb8ab5ce8b68a7d7e2a749
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-06-12 16:27:18 +02:00
Oswald Buddenhagen
4e30c5f706 make .qmake.{super,cache,conf} find "anchored" features
these files function as "anchors" for mkspecs/ and features/ directories
used by projects which load these files. ironically, these files didn't
see these feature files themselves.

Change-Id: I590855eb4a9d2c72b9abfcaa431d2f85a719c6e2
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-06-12 16:27:15 +02:00
Oswald Buddenhagen
75aa1f0ce9 find features/ under mkspecs/ of source & build root
we were finding features/ directly in the source & build root, and we
were finding features/ under mkspecs/ from $QMAKEPATH and other mkspecs
locations, but we omitted the "transitive hull". this was
counterintuitive.

Change-Id: I9823e6606467c98f264c81385250da92311f51ca
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-06-12 16:27:12 +02:00
Oswald Buddenhagen
da8504b2ac add missing ifdefery
sync up implementation with qtcreator.

Change-Id: I6a1578818512fa3b0773faf276a1d56881eb06d7
(cherry picked from qttools/582cbddc6ba1b74a7e4e07e0b5c23d47de6838cb)
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-06-12 16:27:10 +02:00
Oswald Buddenhagen
52f28060d6 fetch all properties from qmake
sync up implementation with lupdate & creator. no actual effect on
qmake.

don't filter out ^QMAKE_.*:
- QMAKE_MKSPECS is not printed any more, so needs no filtering
- QMAKE_VERSION can be simply used now, as we are now rather close to the
  real qmake
- QMAKE_SPEC and QMAKE_XSPEC need to be fetched
  - this fixes the default spec resolution

Change-Id: Ifcfa8b5b9e2bbf5d995940e1bb7f55e7d67aed3e
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qttools/0037bef09ca77c5ae4d20bd09294ba1d57537e09)
2013-06-12 16:27:07 +02:00
Oswald Buddenhagen
fe8dcfaef1 make stubs for dangerous/useless qmake functions in limited mode
sync up implementation with lupdate & creator. no actual effect on
qmake.

Change-Id: I1bdeb759e895e4200f09332dadf8a6cef348182f
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qttools/94ab2efb2d155d3c1ca7b91c1daf443a149bcf1f)
2013-06-12 16:27:04 +02:00
Oswald Buddenhagen
5957a8e01b update size calculations for assignment statements
this was forgotten when the value lists were extended by a size hint.

Change-Id: I6f9b55ed671224a9b8735c8d937f94aac4a73a42
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
(cherry picked from qtcreator/f24c9865306624c2fc150d4bd262a5c4d5a3689a)
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-05-20 15:20:26 +02:00