don't flush qmake command line twice
otherwise variable assignments (including -config options) from $QMAKEFLAGS are lost. Change-Id: I818e9372d2b0ff44333dc3eb8fc3420f84ab01c5 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
parent
d011f64524
commit
864e1ceaf6
@ -99,6 +99,8 @@ public:
|
|||||||
QString pwd;
|
QString pwd;
|
||||||
QStringList precmds, preconfigs, postcmds, postconfigs;
|
QStringList precmds, preconfigs, postcmds, postconfigs;
|
||||||
bool after;
|
bool after;
|
||||||
|
|
||||||
|
void flush() { after = false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class QMAKE_EXPORT QMakeGlobals
|
class QMAKE_EXPORT QMakeGlobals
|
||||||
|
@ -193,9 +193,8 @@ bool usage(const char *a0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
Option::parseCommandLine(QStringList &args)
|
Option::parseCommandLine(QStringList &args, QMakeCmdLineParserState &state)
|
||||||
{
|
{
|
||||||
QMakeCmdLineParserState state(QDir::currentPath());
|
|
||||||
enum { ArgNone, ArgOutput } argState = ArgNone;
|
enum { ArgNone, ArgOutput } argState = ArgNone;
|
||||||
int x = 0;
|
int x = 0;
|
||||||
while (x < args.count()) {
|
while (x < args.count()) {
|
||||||
@ -313,8 +312,6 @@ Option::parseCommandLine(QStringList &args)
|
|||||||
fprintf(stderr, "***Option %s requires a parameter\n", qPrintable(args.at(x - 1)));
|
fprintf(stderr, "***Option %s requires a parameter\n", qPrintable(args.at(x - 1)));
|
||||||
return Option::QMAKE_CMDLINE_SHOW_USAGE | Option::QMAKE_CMDLINE_ERROR;
|
return Option::QMAKE_CMDLINE_SHOW_USAGE | Option::QMAKE_CMDLINE_ERROR;
|
||||||
}
|
}
|
||||||
globals->commitCommandLineArguments(state);
|
|
||||||
globals->debugLevel = Option::debug_level;
|
|
||||||
return Option::QMAKE_CMDLINE_SUCCESS;
|
return Option::QMAKE_CMDLINE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -374,6 +371,7 @@ Option::init(int argc, char **argv)
|
|||||||
Option::qmake_mode = Option::QMAKE_GENERATE_MAKEFILE;
|
Option::qmake_mode = Option::QMAKE_GENERATE_MAKEFILE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QMakeCmdLineParserState cmdstate(QDir::currentPath());
|
||||||
const QByteArray envflags = qgetenv("QMAKEFLAGS");
|
const QByteArray envflags = qgetenv("QMAKEFLAGS");
|
||||||
if (!envflags.isNull()) {
|
if (!envflags.isNull()) {
|
||||||
QStringList args;
|
QStringList args;
|
||||||
@ -399,7 +397,8 @@ Option::init(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
if (hasWord)
|
if (hasWord)
|
||||||
args << QString::fromLocal8Bit(buf);
|
args << QString::fromLocal8Bit(buf);
|
||||||
parseCommandLine(args);
|
parseCommandLine(args, cmdstate);
|
||||||
|
cmdstate.flush();
|
||||||
}
|
}
|
||||||
if(argc && argv) {
|
if(argc && argv) {
|
||||||
QStringList args;
|
QStringList args;
|
||||||
@ -430,7 +429,7 @@ Option::init(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ret = parseCommandLine(args);
|
int ret = parseCommandLine(args, cmdstate);
|
||||||
if(ret != Option::QMAKE_CMDLINE_SUCCESS) {
|
if(ret != Option::QMAKE_CMDLINE_SUCCESS) {
|
||||||
if ((ret & Option::QMAKE_CMDLINE_SHOW_USAGE) != 0)
|
if ((ret & Option::QMAKE_CMDLINE_SHOW_USAGE) != 0)
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
@ -439,6 +438,8 @@ Option::init(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
Option::qmake_args = args;
|
Option::qmake_args = args;
|
||||||
}
|
}
|
||||||
|
globals->commitCommandLineArguments(cmdstate);
|
||||||
|
globals->debugLevel = Option::debug_level;
|
||||||
|
|
||||||
//last chance for defaults
|
//last chance for defaults
|
||||||
if(Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE ||
|
if(Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE ||
|
||||||
|
@ -207,7 +207,7 @@ struct Option
|
|||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static int parseCommandLine(QStringList &args);
|
static int parseCommandLine(QStringList &args, QMakeCmdLineParserState &state);
|
||||||
};
|
};
|
||||||
|
|
||||||
inline QString fixEnvVariables(const QString &x) { return Option::fixString(x, Option::FixEnvVars); }
|
inline QString fixEnvVariables(const QString &x) { return Option::fixString(x, Option::FixEnvVars); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user