summaryrefslogtreecommitdiffstats
path: root/qmake/option.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-08-09 18:54:40 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-14 23:12:23 +0200
commit4350054ab86b03b2a4e6641238b762fd80a3c5dd (patch)
treea0a77728895ebbb046782558a721fc7019d00c29 /qmake/option.cpp
parent1447b6c55b55ca7bd6474524c12948c3e5589d2e (diff)
revamp preparation of command line for qmake calls in makefiles
instead of re-assembling a list from the variables, take the original command line minus some explicitly stripped out options. this is way less code and poses no synchronization problem between the two parts. as a "side effect", variables obtained from $QMAKEFLAGS won't multiply with each makefile nesting level, as the generated command line won't replicate data obtained from the environment. Change-Id: I5d1ce0f11efb338f60405529f9818910103b1b0e Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Diffstat (limited to 'qmake/option.cpp')
-rw-r--r--qmake/option.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/qmake/option.cpp b/qmake/option.cpp
index db212e6daf..24c3fe53a8 100644
--- a/qmake/option.cpp
+++ b/qmake/option.cpp
@@ -79,6 +79,7 @@ Option::QMAKE_MODE Option::qmake_mode = Option::QMAKE_GENERATE_NOTHING;
//all modes
QString Option::qmake_abslocation;
+QStringList Option::qmake_args;
int Option::warn_level = WarnLogic | WarnDeprecated;
int Option::debug_level = 0;
QFile Option::output;
@@ -110,8 +111,6 @@ QString Option::mkfile::source_root;
QString Option::mkfile::build_root;
QString Option::mkfile::cachefile;
QStringList Option::mkfile::project_files;
-QString Option::mkfile::qmakespec_commandline;
-QString Option::mkfile::xqmakespec_commandline;
static Option::QMAKE_MODE default_mode(QString progname)
{
@@ -223,7 +222,9 @@ Option::parseCommandLine(QStringList &args)
if (arg.size() > 1 && arg.startsWith('-')) { /* options */
QString opt = arg.mid(1);
if(opt == "o" || opt == "output") {
- Option::output.setFileName(args.at(++x));
+ Option::output.setFileName(args.at(x + 1));
+ args.erase(args.begin() + x, args.begin() + x + 2);
+ continue;
} else if(opt == "after") {
before = false;
} else if(opt == "t" || opt == "template") {
@@ -260,8 +261,12 @@ Option::parseCommandLine(QStringList &args)
Option::warn_level = WarnNone;
} else if(opt == "r" || opt == "recursive") {
Option::recursive = true;
+ args.removeAt(x);
+ continue;
} else if(opt == "nr" || opt == "norecursive") {
Option::recursive = false;
+ args.removeAt(x);
+ continue;
} else if(opt == "config") {
user_configs += args.at(++x);
} else {
@@ -282,11 +287,9 @@ Option::parseCommandLine(QStringList &args)
} else if(opt == "cache") {
Option::mkfile::cachefile = args.at(++x);
} else if(opt == "platform" || opt == "spec") {
- Option::mkfile::qmakespec = cleanSpec(args.at(++x));
- Option::mkfile::qmakespec_commandline = args.at(x);
+ Option::mkfile::qmakespec = args[x] = cleanSpec(args.at(++x));
} else if (opt == "xplatform" || opt == "xspec") {
- Option::mkfile::xqmakespec = cleanSpec(args.at(++x));
- Option::mkfile::xqmakespec_commandline = args.at(x);
+ Option::mkfile::xqmakespec = args[x] = cleanSpec(args.at(x));
} else {
fprintf(stderr, "***Unknown option -%s\n", opt.toLatin1().constData());
return Option::QMAKE_CMDLINE_SHOW_USAGE | Option::QMAKE_CMDLINE_ERROR;
@@ -333,6 +336,8 @@ Option::parseCommandLine(QStringList &args)
if(!handled) {
return Option::QMAKE_CMDLINE_SHOW_USAGE | Option::QMAKE_CMDLINE_ERROR;
}
+ args.removeAt(x);
+ continue;
}
}
x++;
@@ -474,6 +479,7 @@ Option::init(int argc, char **argv)
return ret;
//return ret == QMAKE_CMDLINE_SHOW_USAGE ? usage(argv[0]) : false;
}
+ Option::qmake_args = args;
}
//last chance for defaults