From ea39013a5401866367e4a0deccfcf58256bdaaa2 Mon Sep 17 00:00:00 2001 From: Rolland Dudemaine Date: Tue, 15 Nov 2011 17:28:21 +0100 Subject: 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 --- qmake/generators/integrity/gbuild.cpp | 5 +++-- 1 file 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()) { -- cgit v0.12