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>
(cherry picked from qtbase/ff31d87cc883dcf17ab459a15eac04e074d9614a)
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
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>
(cherry picked from qtbase/72075656cfeac570ce002c517a22b1c5d7bc0dd0)
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
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>
(cherry picked from qtbase/89ef515177fd5a0b5d95dcffd5fd0b0669e3625a)
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
it produces simply too many false positives.
Change-Id: I3dfa109866450babe5c16f84665ad22024d99e42
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qttools/08bae158320f6d73bf44fcf43f45f51a01334544)
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>
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>
this tremendously speeds up loading of qt 5.1 based projects (including
qt itself) under mac os, as these look up the sdk dynamically, and use
caching to avoid doing that in every subproject.
Change-Id: I833253f81c3159056fab2ff888f293b36cc2ef56
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
just directly use the filename we constructed it from.
Change-Id: Ia428a2cb4b192fea6bde62dfbf35361bcfc4b21e
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
instead of having them "not implemented" (and consequently getting
errors), just let requires(), system(), mkpath(), write_file(), touch()
and cache() do nothing. this is likely to cause followup failures which
are harder to detect, but the amount of scary noise we are producing now
is not really acceptable. furthermore, in qtcreator these failures
actually terminate the "precise" evaluation, which breaks Run
Configurations.
Task-number: QTBUG-28159 (in different repo)
Task-number: QTCREATORBUG-8550
Change-Id: I1bdeb759e895e4200f09332dadf8a6cef348182f
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qttools/94ab2efb2d155d3c1ca7b91c1daf443a149bcf1f)
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
the functions are not versioned or scoped, so user-defined overloads would
mess up qmake's own feature files. it seems safer to break user projects
than to allow the user to break qmake.
Change-Id: I020a2e6416bbb6e2fd2ece339629d848c00c8398
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
(cherry picked from qtbase/849f1f9efda601bcfd3760256205a2014e0bc936)
we have been warning about such functions for a while now, now execute.
the qmake language is (generally) case-sensitive, so this wasn't all
that useful anyway.
Change-Id: I1388ac2d5a1104389aeb3347e739a0d5e69e138d
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
(cherry picked from qtbase/b04192d94b9fb680f99ae38ff008919c0ad371ea)
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
When writing a file with write_file() we have to inform the pro file parser
cache to discard the file if it's existent in the cache, to ensure that
calling include() after write_file() always works.
Change-Id: I7d09269a57de55ca30b0e11dd40770de9f919f64
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
(cherry picked from qtbase/f45d6414ad6ef1d75f049a61411cd954bcae29c3)
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
in the case of sprintf it's surprising, in the case of join it's
anti-thetical.
Change-Id: I4eb7e56d31ac6ed68adf852f1a19b33554d38eb4
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
(cherry picked from qtbase/ae94bf2b7a6373def9239ae5f54b143e1f6ffe09)
this is undeniably a new feature, but it's needed for a bugfix.
Change-Id: I951a3128eb580404ee0c7e3cdcb4d6170e899f70
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qtbase/87054805872429c1c17135f9ae5364b050d3fdff)
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
# skip ast (excluding paste, astpath, and canv'ast'imer)
next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
s = File.read(file)
next if s.include?('qlalr')
orig = s.dup
s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
res = $&
if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
res
else
res.gsub!('} else', 'else')
res.gsub!(/\n +} *\n/m, "\n")
res.gsub(/ *{$/, '')
end
}
s.gsub!(/ *$/, '')
File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
Warnings came up using MinGW 4.4:
* botan.cpp: integer constant is too large for 'long' type
* dnssd_clientlib.c, dnssd_clientstub.c: ignoring #pragma warning
* hostutils.cpp: comparison between signed and unsigned integer expressions
* qmakebuildins.cpp: 'QString windowsErrorCode()' defined but not used
Change-Id: I80827f7f740ff380f13cef96d6b43baaa7e179cb
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
Reviewed-by: hjk <qthjk@ovi.com>
it's a pretty braindead thing to implement control flow statements as
(built-in) functions.
as a "side effect", this fixes return() value handling for lists.
Change-Id: I59c8efa0e4d65329327115f7f8ed20719e7f7546
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
only creator needs to set an own environment - the testreader, lupdate
and qmake don't.
Change-Id: I4ff561a3008d423969a3f331bdc5d16b281a020b
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
this makes us independent from the random access performance of the
underlying container.
Change-Id: I0e655320ad607ac43ef6797e52e6179570c155f4
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
will need a second entry path, so it's better to have them separate
Change-Id: I52bce5de536fd0ef5d6773d8177550b8d6202d1d
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
this is a more natural naming scheme
Change-Id: I376b16d14924d6c816b4eeab5169f54890164388
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
"(eval)" does not exactly help to find the error source.
Change-Id: Iecd03e6a4909ca6d7eab846844ca4415ebfa3429
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
all callers use the same value, so just inline it in the function.
Change-Id: Icc3f1301ec332cb18f5011b8abfb20703e94a491
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
as other output code which is enabled only in full qmake mode, this
prints directly to the console.
Change-Id: I6a1578818512fa3b0773faf276a1d56881eb06d7
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
the value map stack always has at least one map on it.
Change-Id: I836de07a14754b995403065443d3758bfc6a8683
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
while this is actually just an alias for ProString (with explicit
zero-cost conversions only), it nicely illustrates the use of particular
variables. it also serves to hide the NoHash hack from public view.
Change-Id: Iaf9283c64f320ad84a77d9573d1fde6d401c49df
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
the other branch in the function also does it
Change-Id: I74e27fa0bb997b95df904f5be48d1f251814c323
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
this makes it identical to the bootstrapped path used by qmake itself.
this applies only to full qmake mode.
Change-Id: I7100315fe95d0ee900f6bea2552c9292e3d1a07d
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>