diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2011-09-12 07:49:03 +0200 |
---|---|---|
committer | Gunnar Sletta <gunnar.sletta@nokia.com> | 2011-09-12 07:49:03 +0200 |
commit | a9ac6da893ac10ce160c9eb80141508881cd71e2 (patch) | |
tree | 0e74067407612d44ad07ff74cb7be6d444ee28c5 /src/tools/moc | |
parent | 8eb5ba3b9cb1e8e07f28a3153672a946b2d82fd9 (diff) | |
parent | 687461627310e8b781da15d1a907c35bd8ffea6e (diff) |
Merge branch 'master' into refactor
Conflicts:
src/3rdparty/v8
src/gui/text/qfont_qpa.cpp
src/gui/widgets/qlinecontrol.cpp
src/plugins/platforms/fontdatabases/fontconfig/qfontconfigdatabase.cpp
tests/auto/gui.pro
tests/auto/network.pro
tests/auto/qstring/tst_qstring.cpp
Change-Id: Id118c172645303ccf06a207050d5bf1462ff57fe
Diffstat (limited to 'src/tools/moc')
-rw-r--r-- | src/tools/moc/main.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/tools/moc/main.cpp b/src/tools/moc/main.cpp index eaafd0a9fd..bf7e22c0b9 100644 --- a/src/tools/moc/main.cpp +++ b/src/tools/moc/main.cpp @@ -83,7 +83,8 @@ void error(const char *msg = "Invalid argument") " -U<macro> undefine macro\n" " -i do not generate an #include statement\n" " -p<path> path prefix for included file\n" - " -f[<file>] force #include, optional file name\n" + " -f[<file>] force #include, optional file name (overwrite default)\n" + " -b<file> prepend #include <file> (preserve default include)\n" " -nn do not display notes\n" " -nw do not display warnings\n" " @<file> read additional options from file\n" @@ -156,6 +157,7 @@ QByteArray composePreprocessorOutput(const Symbols &symbols) { int runMoc(int _argc, char **_argv) { bool autoInclude = true; + bool defaultInclude = true; Preprocessor pp; Moc moc; pp.macros["Q_MOC_RUN"]; @@ -226,8 +228,21 @@ int runMoc(int _argc, char **_argv) break; moc.noInclude = false; autoInclude = false; - if (opt[1]) // -fsomething.h + if (opt[1]) { // -fsomething.h moc.includeFiles.append(opt.mid(1)); + defaultInclude = false; + } + break; + case 'b': + if (ignoreConflictingOptions) + break; + if (!more) { + if (!(n < argc-1)) + error("Missing file name for the -b option."); + moc.includeFiles.prepend(argv[++n]); + } else if (opt[1]) { + moc.includeFiles.prepend(opt.mid(1)); + } break; case 'p': // include file path if (ignoreConflictingOptions) @@ -341,7 +356,7 @@ int runMoc(int _argc, char **_argv) // spos >= -1 && ppos > spos => ppos >= 0 moc.noInclude = (ppos > spos && tolower(filename[ppos + 1]) != 'h'); } - if (moc.includeFiles.isEmpty()) { + if (defaultInclude) { if (moc.includePath.isEmpty()) { if (filename.size()) { if (output.size()) |