diff options
| author | Matthias Kretz <kretz@kde.org> | 2007-07-17 21:24:19 +0000 | 
|---|---|---|
| committer | Matthias Kretz <kretz@kde.org> | 2007-07-17 21:24:19 +0000 | 
| commit | 06188a53edc18b08ec3e30b489ab5e99a71633b5 (patch) | |
| tree | 6bdc8cb795be27c14c4afc67967f1dae7610d172 /automoc/kde4automoc.cpp | |
| parent | febc9bb214c1307a2ff3ce94d52504f72218ac91 (diff) | |
| download | extra-cmake-modules-06188a53edc18b08ec3e30b489ab5e99a71633b5.tar.gz extra-cmake-modules-06188a53edc18b08ec3e30b489ab5e99a71633b5.tar.bz2 | |
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
Diffstat (limited to 'automoc/kde4automoc.cpp')
| -rw-r--r-- | automoc/kde4automoc.cpp | 16 | 
1 files changed, 10 insertions, 6 deletions
| 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(); | 
