From 06188a53edc18b08ec3e30b489ab5e99a71633b5 Mon Sep 17 00:00:00 2001 From: Matthias Kretz Date: Tue, 17 Jul 2007 21:24:19 +0000 Subject: thiago suggested to add an enum if the _automoc.cpp file is otherwise empty, so that the compiler cannot complain that the source file would be empty svn path=/trunk/KDE/kdelibs/; revision=689197 --- automoc/kde4automoc.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'automoc/kde4automoc.cpp') diff --git a/automoc/kde4automoc.cpp b/automoc/kde4automoc.cpp index 81075dec..f79c0ca8 100644 --- a/automoc/kde4automoc.cpp +++ b/automoc/kde4automoc.cpp @@ -234,12 +234,16 @@ bool AutoMoc::run() QTextStream outStream(&outfile); outStream << "/* This file is autogenerated, do not edit */\n"; - // run moc on the remaining headers and include them in the _automoc.cpp file - end = notIncludedMocs.constEnd(); - it = notIncludedMocs.constBegin(); - for (; it != end; ++it) { - generateMoc(it.key(), it.value()); - outStream << "#include \"" << it.value() << "\"\n"; + if (notIncludedMocs.isEmpty()) { + outStream << "enum some_compilers { need_more_than_nothing };\n"; + } else { + // run moc on the remaining headers and include them in the _automoc.cpp file + end = notIncludedMocs.constEnd(); + it = notIncludedMocs.constBegin(); + for (; it != end; ++it) { + generateMoc(it.key(), it.value()); + outStream << "#include \"" << it.value() << "\"\n"; + } } outfile.close(); -- cgit v1.2.1