Commit Graph

316 Commits

Author SHA1 Message Date
Oswald Buddenhagen
3db9344f04 beautify string operations
Change-Id: I895a1ae26ee0c884c404bf585261d1a7e8a8242c
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-08-28 20:48:13 +02:00
Oswald Buddenhagen
996bbcd78b micro-optimize: use POD-initializable lists of variable names
Change-Id: I3732fef509b358949ef90002dbfc1960360afef8
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-08-28 20:48:07 +02:00
Oswald Buddenhagen
7251683085 remove unused checkMultipleDefinition()
Change-Id: I533c2091333942f145063ad04f4420b7a2de0a37
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-08-28 20:48:03 +02:00
Oswald Buddenhagen
7033560e54 remove dead variable assignments
Change-Id: I032e9116ca1b7250497f56ea26103f2173f0fc09
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-28 20:47:55 +02:00
Miikka Heikkinen
62b0f41ae0 Remove automatic drive letter lowercasing from Option::fixString()
This enforced lowercasing causes subtle errors, like changing the
drive letter case when doing $$files(), which makes it difficult
to do any string matching against the result later.

Task-number: QTBUG-26985
Change-Id: I4973e3ac3e851e24af944295edf290cc98f02fb6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-28 00:10:45 +02:00
Joerg Bornemann
8633f7ac0d qmake: fix manifest resource for non-trivial target names
The Microsoft Resource Compiler bails out if the rc file contains
non-trivial file name references. In particular it doesn't like
dashes in file names. We're now always quoting the file name.

Change-Id: I67b8d2c13010a0b2ec26cac915ebd1be95f1c274
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-23 15:54:02 +02:00
Joerg Bornemann
d45ef22158 qmake: fix embedding of generated manifests in debug mode
The existence of the manifest backup is used as a marker to decide
whether to embed the manifest in a second link step or not.
If it's present, the embedding took place in the first link step.
If it's not present, we must link again incrementally.
That logic was implemented faulty.

Change-Id: I10154dbbbe70c7981795ac66d46a166907ba13ec
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-22 18:40:17 +02:00
Joerg Bornemann
0330798037 qmake: fix generated rc file for embedding manifests
The rc file is in the same directory as the manifest file.
Therefore the include must consist of the filename and must not include
the file's path.

Change-Id: I4f5ac11b131f39ea8c425aca93fcf82d150c0204
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-22 18:40:17 +02:00
Joerg Bornemann
a72420d012 qmake: object_with_source feature removed
By putting object_with_source into CONFIG one could force qmake to
output each object file into the same directory as its source file
came from. This was a rather nasty work-around from Qt 3 times to
support source files with the same file name in a project.
Unfortunately this doesn't play nicely with shadow builds.

Change-Id: Ie79e14d36ba6eac4219edc14ea75ab6a96f9ea96
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-17 12:27:40 +02:00
Oswald Buddenhagen
af2847260c unbreak "aux" template for mingw & msvc
we cannot just completely stub it out, as then there are no dependencies
on whatever targets we actually *want* to be built.

Change-Id: I32a92fa937d099c153a0082feae5d23e3998ba48
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-17 12:27:05 +02:00
Oswald Buddenhagen
e243f4e291 beautify "aux" target
it works better when it castrates the app template, rather than staticlib

Change-Id: If52960fb48d770e8ec096c66b579539512b8d299
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-17 12:27:01 +02:00
Joerg Bornemann
c9406bcffe qmake: support incremental linking when embedding manifests
When embedding manifests we modified the EXE/DLL after linking using
the manifest tool. This breaks the incremental linking feature of MSVC.

The MS way to embed a manifest without breaking incremental linking is:
   - let the linker create the manifest file,
   - create a resource that contains the manifest file,
   - invoke the linker again to embed the resource.

The embed_manifest_{exe|dll}.prf files have been removed.
All manifest logic is now in qmake's nmake makefile generator.

With QMAKE_MANIFEST one can specify a custom manifest file that gets
embedded without disturbing incremental linking.

Task-number: QTBUG-22718
Change-Id: Idb9d2644a0577b2002cbdd2d62b695b9171b1bd5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-16 08:26:24 +02:00
Oswald Buddenhagen
4350054ab8 revamp preparation of command line for qmake calls in makefiles
instead of re-assembling a list from the variables, take the original
command line minus some explicitly stripped out options. this is way
less code and poses no synchronization problem between the two parts.

as a "side effect", variables obtained from $QMAKEFLAGS won't multiply
with each makefile nesting level, as the generated command line won't
replicate data obtained from the environment.

Change-Id: I5d1ce0f11efb338f60405529f9818910103b1b0e
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-14 23:12:23 +02:00
Oswald Buddenhagen
1447b6c55b make command line parser use qt containers
way more legible code

Change-Id: I7ba5a66f1f0bc7ae78ba0537ef8e5c780506a149
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-14 23:12:23 +02:00
Oswald Buddenhagen
807579ff64 take parsing of qmake mode out of parseCommandLine()
it wouldn't do anything particularly useful when parsing QMAKEFLAGS, so
take it out of the common path.

Change-Id: I60f1215c4645707e1f99932dd19160e1d1c9d953
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-14 23:12:23 +02:00
Oswald Buddenhagen
910c717461 remove rather pointless parameter from parseCommandLine()
Change-Id: I97998555c41e8eab2438ac355950abf9dace24a0
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-14 23:12:23 +02:00
Marius Storm-Olsen
addc9984fb Sync .pr[oi] with the Makefiles so qmake builds again
Change-Id: Ief766ac61f98859b84fc61b03b8c1292d3c06525
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-13 14:52:25 +02:00
Oswald Buddenhagen
f8ff2ae69e support installs with target dir
this adds a .base "member" to the install "structure". if specified, only
this much is stripped from the front of each element of .files, rather
than the entire path, to obtain the target filename.

Change-Id: Ic39fcf71c4ad874ffabbbad113be9cdc6e3f7260
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-08 12:04:49 +02:00
Oswald Buddenhagen
ff192b3c62 reshuffle assembly of install commands as well
don't make a single string, but a string list which is join()ed in the end.
this is a tad slower, but the code is way easier to work with.

Change-Id: I1ff7168c2770998761a6081be8080c743ddc94a1
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-08 12:04:49 +02:00
Oswald Buddenhagen
350d5ff3dd reshuffle assembly of uninstall commands
make a proper stringlist of commands, and join it in reverse order
only at the end. the reversal ensures that we can cleanly fold up
directory hierarchies we may build.

Change-Id: I9a241361588a6965283aec5258e1d622b35514e0
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-08 12:04:49 +02:00
Oswald Buddenhagen
14d0dc1dca remove pointless appending of trailing dir separator under unix
Change-Id: Ia9b181db57ac2ee93cd412d58fe6ecbc5637a2f0
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-08 12:04:49 +02:00
Andreas Holzammer
495017e5d4 Rename msvc11 to msvc2012
Microsoft has named their new Visual Studio again
after the old naming schema.

Change-Id: Ib1b971807fa89d90b10892a2d78570058e564f3a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
2012-08-07 23:27:17 +02:00
Joerg Bornemann
e81d7fd1e5 qmake vcxproj generator: map TARGET_EXT to $(TargetExt)
Task-number: QTBUG-26782

Change-Id: Ib143fa6b8674c4d09d798a9301bb209b886e791d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-07 18:55:43 +02:00
Joerg Bornemann
b4ae57c881 qmake: un-copy-and-pastify vcxproj generator a bit
Reusing already built strings improves readability and performance.

Change-Id: I8555fb860561ff214ae123efeda78fc770b6459f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-07 18:55:43 +02:00
Andy Shaw
372cc6b506 Add the filters for extra compilers for vcxproj files
The files were grouped into the relevant filters but the filters
themselves were not added.  This now ensures the filters are added to the
vcxproj files so they appear grouped correctly.

Task-number: QTBUG-26755

Change-Id: I7d2c6fa96dcbb0496fd9d1bb1d01e7dd660052f4
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-07 18:55:43 +02:00
Oswald Buddenhagen
c292f1dc8a respect copy_dir_files with manually flagged directories as well
otherwise the second installation on unix would be bogus.

Change-Id: I162533ee262c6820e7e2d4710b5342cafecd9d59
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-07 16:40:07 +02:00
Oswald Buddenhagen
86d1f7a61b remove not particularly useful branch
we just determined that the file does not exist, so it's entirely
pointless to query its type from the file system. consequently, the
respective fallback branch would assume a regular file anyway.

Change-Id: I42590ffc2a5f650fb430a9398cb1859217ed4350
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-07 16:40:07 +02:00
Oswald Buddenhagen
3c2f56aaf2 remove clearly bogus escapeFilePath() call
the value is still re-processed numerous times, end each "exit path"
does own escaping, while not every path can deal with an escaped path.

Change-Id: I0bf4a043809bf4b7877d02e5d8dfe8f794a7dd00
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-07 16:40:07 +02:00
Oswald Buddenhagen
68cbeb59d9 make $$relative_path() minimize already relative paths
QDir::relativeFilePath() doesn't do anything if the path is already
relative, so make it absolute first to force a re-calculation.

the cleanPath() is gone, as relativeFilePath() already does that.

Change-Id: I8f4d0d839db3fe99a608f70916b4b5bd52c56535
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-07 16:40:07 +02:00
Rafael Roquetto
6f580d6a5a Fix qmake -project
qmake -project was always outputting a project with subdirs template, because
Option::h_moc_mod was not being properly read, causing addFile() to misbehave.

Change-Id: I2c07aea132f9885eabf188de993b0fabfb352886
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-06 16:04:03 +02:00
Oswald Buddenhagen
e185f343e4 findLibraries(): don't remove -L options for system paths
the paths may be explicitly added before some other paths, so it would
be wrong to remove them.

Change-Id: I68ae93fd307afe14a07a0f24de952783950b5bea
Reviewed-by: Holger Freyther <holger+qt@freyther.de>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-04 08:15:18 +02:00
Andy Shaw
44a7330d67 Remove references to Borland and bmake
Remove references to an old compiler that has not been
supported for a long time.  Also remove Borland specific
configuration flags which have no meaning elsewhere.

Change-Id: I3634a52b78f737ea972073e14c2b6669dcd0ae63
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-01 12:39:39 +02:00
Oswald Buddenhagen
9a8d74de0a remove second argument from $$eval() (access to global scope)
sam added this based on a vague notion of backwards compatibility when
he fixed the function to use the local scope, but it kind of makes no
sense - there is very little reason for accessing the global scope from
within a function. google doesn't find any relevant hits except our
source code, so let's just nuke it.

Change-Id: Ie957bb47b531f7e9b5dfcceb4e09f65dd826b422
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-31 11:17:50 +02:00
Oswald Buddenhagen
c595405124 run processPrlFiles() over QMAKE_LIBS_PRIVATE as well
there is no reason why private libs should not have prls resolved.

the two variables are resolved independently, so it's possible that
(even more) libraries will appear duplicated on the linker command line,
but that seems easiest for the time being.

Change-Id: I9070ba53808a0661fa72949db8111106b7aca487
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-31 11:17:43 +02:00
Oswald Buddenhagen
14bf7ef504 inline MakefileGenerator::processPrlVariable()
the visitor-pattern like approach is not needed any more

Change-Id: I990db681cbeee91d89ecba97745a8104595247e7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-31 11:17:40 +02:00
Oswald Buddenhagen
f71a5c8cde make the windows prl processing more like the unix variant
it's more elegant, and more similar code is better.

Change-Id: I2b8b036cb70a932fd171e23cf7d3389188401924
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-31 11:17:37 +02:00
Oswald Buddenhagen
202f08dc09 remove apparently useless code
it wouldn't actually *do* anything, as l is not a reference. i cannot
figure out the original intention, so let's just drop it.

Change-Id: Ic0a3457a1872cde827259ee5530959120456e934
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-31 11:17:34 +02:00
Oswald Buddenhagen
02cbc0746d stub out MakefileGenerator::processPrlFiles()
the unix and windows variants don't rely on it.
not making it purely virtual only because the project generator inherits
MakefileGenerator as well but does not need an implementation.

Change-Id: I80099b3f5d07cd037b408cf1099c58ff3a2904cd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-31 11:17:30 +02:00
Oswald Buddenhagen
5e965df21d do not look for frameworks in library path
it's just wrong

Change-Id: Ia21e9fb7e67623d6c4f70eab1f76360624ba314b
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-28 00:09:45 +02:00
Oswald Buddenhagen
5bc9541e7a insert explicit library search paths before system search paths
... as the linker does.

Change-Id: I4a030d9e2f281b892b78ba25b11f6df6b0893712
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-28 00:09:45 +02:00
Oswald Buddenhagen
baf1f46b21 look into /Library/Frameworks as well in processPrlFiles()
Change-Id: I445b9d1d3cd349eb7981b1aec824e6878b0c16e7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-28 00:09:45 +02:00
Oswald Buddenhagen
b9a41f9630 unify default search paths between findLibraries() & processPrlFiles()
i see no reason why they should deviate

Change-Id: Iaa0445b79a95d348f51df74a74c7c89216c468ec
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-28 00:09:45 +02:00
Oswald Buddenhagen
c451a1087e fix lookup of libraries with a full path but without extension
given that nobody noticed so far how broken this was, this doesn't
appear to be a particularly common path. but anyway ...

Change-Id: Ic17b239d724a4d69ff414a24be2e8588732bc8dd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-28 00:09:45 +02:00
Oswald Buddenhagen
ad5e583956 don't actually resolve frameworks in findLibraries()
the code wouldn't actually *do* anything with them, because it was
completely broken. didn't seem to hurt, so just remove it.
we still need to parse -framework, though, so we don't do funny things
with its possible argument.

Change-Id: Ia3266538612d3314a72f4965ee9c1ea2d3046ac9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-28 00:09:45 +02:00
Oswald Buddenhagen
e07372ff50 fix host vs. makefile directory separator mess
the system path separator and shell are bound to the host system
(system() will use cmd even on mingw with sh.exe in path).
the makefiles otoh may depend on what the qmakespec defines.

consequently, add $$system_path() and $$system_quote() (for use with
system() & $$system()). $$native_path() is renamed to $$shell_path() and
should be used with $$shell_quote() to produce command lines in
makefiles.
$$QMAKE_DIR_SEP needs to be applied to Option::dir_sep right after
parsing the spec, so it is available to $$shell_{path,quote}().

Change-Id: If3db4849e7f96068cf03a32348a24f3a72d6292c
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2012-07-28 00:09:45 +02:00
Oswald Buddenhagen
022f8ebd13 merge QMAKE_LIBDIR into QMAKE_LIBS early
dealing with the directories separately doesn't buy us anything. it's
easier to mix them into the libs, as that contains some paths, too, both
in projects and in prl files.

this brings the windows generators in line with the unix ones.

Change-Id: I1f58f7edd8e21d28bfabf04384bac2e315aaf446
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-27 16:29:38 +02:00
Oswald Buddenhagen
10fba42d71 unifiy initialization of QMAKE_LIBS{,_PRIVATE} among windows generators
Change-Id: Ib24ec6e290bfb277232c2483768c1b863f961462
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-27 16:29:34 +02:00
Oswald Buddenhagen
b053aaa9ef clean up fixTargetExt()
there doesn't appear to be a point in having the function virtual; the
part in the mingw generator can be inlined somewhere else just fine.

Change-Id: I50d66d505095b43fce601928c6240a684389a4b7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-27 16:29:29 +02:00
Oswald Buddenhagen
a102f1abf2 de-virtualize some more functions
they are not re-implemented anywhere

Change-Id: I444a967bb39ec6b5994747c9fa3f605b4c53ce4f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-27 16:29:23 +02:00
Oswald Buddenhagen
e38af23470 dispose of QMAKE_LIBDIR_FLAGS, "demote" QMAKE_FRAMEWORKPATH_FLAGS
merge their content as early as possible into QMAKE_LIBS. that's where
they ultimately end up anyway, and this approach is way simpler.
QMAKE_FRAMEWORKPATH_FLAGS is also used for the compiler flags, so it
remains as such in this second function.

Change-Id: Idc3ba4a9b2569fce3252d5f5ddc3f6ebf93650cf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-27 16:29:18 +02:00