Commit Graph

23 Commits

Author SHA1 Message Date
Oswald Buddenhagen
815a41f714 make use of silent error() emission
get rid of the entirely superfluous stock "Aborting." messages -
the event triggering the exit has already reported the problem.

Change-Id: Ib9dfb9e4212f60eceb2ea432cdf56c5a8afe9d65
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-08 09:48:41 +00:00
Thiago Macieira
da04322b4c Make moc obey the preprocessor environment variable for include paths
C preprocessors augment their standard list of include paths from the
environment: Unix preprocessors use $C_INCLUDE_PATH (for C) and
$CPLUS_INCLUDE_PATH (for C++), plus CPATH for both, whereas MSVC uses
the an environment variable simply called "INCLUDE". Handling this for
MSVC is particularly important because the VCVARSALL.BAT script sets the
necessary #include paths in the environment for important things.
Without that being parsed, moc won't find some #defines, like
WINAPI_DESKTOP_FAMILY.

[ChangeLog][moc] qmake and moc now cooperate to use the Visual Studio
environment variables (set by the VCVARSALL.BAT script) to find system
include files. A possible consequence is that moc parses application
headers slightly differently, depending on #if conditions that depended
on macros that previous versions had not seen #define'd. Implementers of
other buildsystems are advised to pass the --compiler-flavor=msvc option
to moc.

Change-Id: I7e06274214d1939b0124e5b4bf169cceaef9ca46
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-07-20 02:54:09 +00:00
Thiago Macieira
36d524e6a3 moc: get the system #defines from the compiler itself
In order for moc to properly parse #ifdefs and family, we've had
QMAKE_COMPILER_DEFINES as a list of pre-defined macros from the
compiler. That list is woefully incomplete.

Instead, let's simply ask the compiler for the list. With GCC and
family, we use the -dM flag while preprocessing. With ICC on Windows,
the flag gains an extra "Q" but is otherwise the same. For MSVC, it
requires using some undocumented switches and parsing environment
variables (I've tested MSVC 2012, 2013 and 2015).

The new moc option is called --include to be similar to GCC's -include
option. It does more than just parse a list of pre-defined macros and
can be used to insert any sort of code that moc needs to parse prior to
the main file.

Change-Id: I7de033f80b0e4431b7f1ffff13fca02dbb60a0a6
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-07-20 02:54:03 +00:00
Oswald Buddenhagen
b3fcaea5f2 make extra compiler targets depend on their respective compiler
Change-Id: I6c04e0188137f6bbfeab243f00860b8ff079f69a
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-04-18 09:38:10 +00:00
Andy Shaw
b7f4346c4f Windows: Change the mocinclude extension to .opt
When cleaning in Visual Studio then it will remove all instances of tmp
files which meant it would remove the mocinclude.tmp as well incorrectly.
Therefore the extension of the mocinclude file needs to be changed to .opt
so that it is left untouched by Visual Studio.

Change-Id: Iebc055f33f9dc87a4fa42ae87b253f6739903e8f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-09-29 09:16:00 +00:00
Thiago Macieira
49df5fc3d2 Fix compilation when including files created in shadow dirs
For normal #includes, moc simply ignores the missing file, but it could
generate problems later. It's a problem when the file being sought is
the FILE from plugin metadata. A very good example of this is Qt
Creator:

coreplugin.h:49: Error: Plugin Metadata file "Core.json" does not exist.

Change-Id: I16af04b477f52c6bd53c14147ec777b358dfdf50
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-02-10 20:41:22 +01:00
Oswald Buddenhagen
b4c31488a7 resolve include paths against source dir
this hasn't happened yet at this point of processing, so we'd pass bogus
paths when shadow-building.

Change-Id: I9f9633c0dbc2aadeff1eb555a8e598ddb0837e37
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-01-29 00:18:15 +01:00
Oswald Buddenhagen
bfbc17159f shell-quote include paths when not using a response file
Change-Id: I7557480dcd8ba1e0b5ecf88318c53cdfb3519f92
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-01-29 00:18:15 +01:00
Oswald Buddenhagen
30efc99c67 use the response file also for the default incdirs
Change-Id: I328cdd32d43f263992af206c66b502564e954d53
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-01-29 00:18:15 +01:00
Oswald Buddenhagen
6d5df33d58 use write_file() to create the response file with the includes
it's much shorter and faster.

Change-Id: I6a37e9ece4ac550d1887fa53523b85046d398c8c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-01-29 00:18:15 +01:00
Thiago Macieira
0b144bc76a Add support for using -isystem in qmake
This commit will make qmake use -isystem automatically for any
compilers that declare support for it for any paths that are listed in
QMAKE_DEFAULT_INCDIRS.

Change-Id: I36fefc6d5bba61671f65669f0ea42704b3c3cf31
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-01-20 02:42:31 +01:00
Thiago Macieira
93a895a41a Ensure that the mkspec and source dirs are passed to moc on Windows
Those paths need not be in INCLUDEPATH: qmake always adds them to the
compiler command-line and we should match the behavior if we expand
INCLUDEPATH here.

Change-Id: I89508d15ac534b54ae873a42c4ad9764408042b5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-01-16 03:00:29 +01:00
Axel Waggershauser
1622dca213 Fix whitespace issues in *.prf
Replaced tabs with spaces to align with space-indented code
and removed some trailing whitespace.

Change-Id: I4930afc3df206ef8ee96de3e69f0d69fc4a1c77c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-03-22 19:52:26 +01:00
Oswald Buddenhagen
d9ba123c6e append $$QMAKE_DEFAULT_INCDIRS to moc invocations
unlike the real compiler, moc does not have these directories built in,
so it would not find headers from a system install of qt.

Task-number: QTBUG-28870
Change-Id: I86f18cdc8953145190163746dae59f4e784f2d78
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-03-15 17:58:06 +01:00
Oswald Buddenhagen
b965c30071 de-duplicate code a bit
Change-Id: I35cd81e308c512bdec50de1f19ae9c708012afa0
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-03-15 17:58:02 +01:00
Oswald Buddenhagen
72e81619d9 remove overuse of $$list()
Change-Id: I383b0af8c37acd9dc34a8cf5718f4d850099b64b
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-03-15 17:57:59 +01:00
Oswald Buddenhagen
14382d77c5 simplify code by using new $$absolute_path() function
Change-Id: Ie8102eea5c2b108154b76ed35bdbc6d8572bd4a5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-12-07 19:54:39 +01:00
Oswald Buddenhagen
4ac264117a remove pointless conditionals+branches
the surrounding TEMPLATE == vc* scope already implies vcproj, as dsp is
not supported any more.

Change-Id: I68363aca62e21135f42572040ccc7b189dcf32c8
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-09-19 19:54:44 +02:00
Oswald Buddenhagen
0f548b1744 remove backwards compatibility hacks
there won't be terribly many projects relying on it. now's the time to
find out for sure ...

this reverts commit 3279b07302fde0eb14f9b197c9ad2e14d512817e

Change-Id: Id36687ab3bfc7dd5ce35b584621a8f5b3ee00fc9
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:46:00 +02:00
Oswald Buddenhagen
d6206075be remove automatic building of moc from moc.prf
the problem this (probably) tried to solve has been solved via ordered
builds a *long* time ago.

Change-Id: I84c58076c864735eea4210ec60aa060fe3e5d97e
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-03-08 18:55:53 +01:00
Joerg Bornemann
981dd3b314 qmake: remove symbian support
Change-Id: I1db834500921681676a6f46e7750bdd81bf0093d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2011-11-07 13:26:41 +01:00
Keno Fischer
b2780e60c7 added QMAKE_MOC_OPTIONS variable to qmake
Merge-request: 41
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>

Change-Id: I8d492e9fbdbeeffa9f702a3a1f2fab314586809f
Reviewed-on: http://codereview.qt-project.org/4375
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2011-09-07 19:04:20 +02:00
Qt by Nokia
38be0d1383 Initial import from the monolithic Qt.
This is the beginning of revision history for this module. If you
want to look at revision history older than this, please refer to the
Qt Git wiki for how to use Git history grafting. At the time of
writing, this wiki is located here:

http://qt.gitorious.org/qt/pages/GitIntroductionWithQt

If you have already performed the grafting and you don't see any
history beyond this commit, try running "git log" with the "--follow"
argument.

Branched from the monolithic repo, Qt master branch, at commit
896db169ea224deb96c59ce8af800d019de63f12
2011-04-27 12:05:43 +02:00