summaryrefslogtreecommitdiffstats
path: root/qmake/generators
diff options
context:
space:
mode:
authorRolland Dudemaine <rolland@ghs.com>2011-11-15 16:28:21 (GMT)
committerHarald Fernengel <harald.fernengel@nokia.com>2011-11-15 16:28:21 (GMT)
commitea39013a5401866367e4a0deccfcf58256bdaaa2 (patch)
tree441009dbe5a1cff2c025249131af132233b381c1 /qmake/generators
parentb721cff590ca7e98f121f483d86bd089787639ff (diff)
downloadQt-ea39013a5401866367e4a0deccfcf58256bdaaa2.zip
Qt-ea39013a5401866367e4a0deccfcf58256bdaaa2.tar.gz
Qt-ea39013a5401866367e4a0deccfcf58256bdaaa2.tar.bz2
Only call moc if the file needs it.
This applies to both headers and cpp files (use mocable()). Previously, moc was called on all cpp and h files, causing additional compilation time, and trouble on QSvgGenerator. Merge-request: 1438 Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
Diffstat (limited to 'qmake/generators')
-rw-r--r--qmake/generators/integrity/gbuild.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/qmake/generators/integrity/gbuild.cpp b/qmake/generators/integrity/gbuild.cpp
index 4601130..0ca470d 100644
--- a/qmake/generators/integrity/gbuild.cpp
+++ b/qmake/generators/integrity/gbuild.cpp
@@ -379,8 +379,9 @@ GBuildMakefileGenerator::writeMakefile(QTextStream &text)
QString GBuildMakefileGenerator::writeOne(QString filename, QString pathtoremove)
{
QString s("");
+ QString origfilename(filename);
s += filename.remove(pathtoremove);
- if (filename.endsWith(Option::h_ext.first())) {
+ if (filename.endsWith(Option::h_ext.first()) && mocable(origfilename)) {
QString corename(filename.section(QDir::separator(), -1));
corename.remove(Option::h_ext.first());
corename.append(Option::cpp_ext.first());
@@ -396,7 +397,7 @@ QString GBuildMakefileGenerator::writeOne(QString filename, QString pathtoremove
s += tmpstr;
s += ".qrc";
s += "\n";
- } else if (filename.endsWith(Option::cpp_ext.first())) {
+ } else if (filename.endsWith(Option::cpp_ext.first()) && mocable(origfilename)) {
QString tmpstr(filename.section("/", -1));
QString filepath(pathtoremove);
if (!project->values("QT_SOURCE_TREE").isEmpty()) {