summaryrefslogtreecommitdiff
path: root/qmake
diff options
context:
space:
mode:
authorRolland Dudemaine <rolland@ghs.com>2011-11-15 17:28:21 +0100
committerHarald Fernengel <harald.fernengel@nokia.com>2011-11-15 17:28:21 +0100
commitea39013a5401866367e4a0deccfcf58256bdaaa2 (patch)
tree441009dbe5a1cff2c025249131af132233b381c1 /qmake
parentb721cff590ca7e98f121f483d86bd089787639ff (diff)
downloadqt4-tools-ea39013a5401866367e4a0deccfcf58256bdaaa2.tar.gz
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')
-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 46011304c2..0ca470d8bf 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()) {