Commit 2f862681 authored by Daniel Teske's avatar Daniel Teske
Browse files

ProcessParameter: Ensure macro expansion is done in the main thread



The macro expanders are not thread safe. Also the values should be
expanded in init() as later changes to e.g. the buildconfiguration
should not affect the build anymore.

Change-Id: I82f5cd229d82cdb9f897c1db69c47b028cca29d1
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 2b2f41db
......@@ -161,6 +161,7 @@ bool AutogenStep::init()
pp->setWorkingDirectory(bc->buildDirectory());
pp->setCommand(QLatin1String("autogen.sh"));
pp->setArguments(additionalArguments());
pp->resolveAll();
return AbstractProcessStep::init();
}
......
......@@ -160,6 +160,7 @@ bool AutoreconfStep::init()
pp->setWorkingDirectory(bc->buildDirectory());
pp->setCommand(QLatin1String("autoreconf"));
pp->setArguments(additionalArguments());
pp->resolveAll();
return AbstractProcessStep::init();
}
......
......@@ -161,6 +161,7 @@ bool ConfigureStep::init()
pp->setWorkingDirectory(bc->buildDirectory());
pp->setCommand(QLatin1String("configure"));
pp->setArguments(additionalArguments());
pp->resolveAll();
return AbstractProcessStep::init();
}
......
......@@ -189,6 +189,7 @@ bool MakeStep::init()
pp->setWorkingDirectory(bc->buildDirectory());
pp->setCommand(tc ? tc->makeCommand(bc->environment()) : QLatin1String("make"));
pp->setArguments(arguments);
pp->resolveAll();
setOutputParser(new GnuMakeParser());
IOutputParser *parser = target()->kit()->createOutputParser();
......
......@@ -198,6 +198,7 @@ bool MakeStep::init()
pp->setWorkingDirectory(bc->buildDirectory());
pp->setCommand(makeCommand(tc, bc->environment()));
pp->setArguments(arguments);
pp->resolveAll();
setOutputParser(new ProjectExplorer::GnuMakeParser());
IOutputParser *parser = target()->kit()->createOutputParser();
......
......@@ -121,6 +121,7 @@ bool GenericMakeStep::init()
pp->setEnvironment(env);
pp->setCommand(makeCommand(bc->environment()));
pp->setArguments(allArguments());
pp->resolveAll();
// If we are cleaning, then make can fail with an error code, but that doesn't mean
// we should stop the clean queue
......
......@@ -198,3 +198,10 @@ QString ProcessParameters::summaryInWorkdir(const QString &displayName) const
prettyArguments(),
QDir::toNativeSeparators(effectiveWorkingDirectory()));
}
void ProcessParameters::resolveAll()
{
effectiveCommand();
effectiveArguments();
effectiveWorkingDirectory();
}
......@@ -76,6 +76,7 @@ public:
QString summary(const QString &displayName) const;
QString summaryInWorkdir(const QString &displayName) const;
void resolveAll();
private:
QString m_workingDirectory;
QString m_command;
......
......@@ -97,6 +97,8 @@ bool ProcessStep::init()
pp->setWorkingDirectory(workingDirectory());
pp->setCommand(m_command);
pp->setArguments(m_arguments);
pp->resolveAll();
IOutputParser *parser = target()->kit()->createOutputParser();
if (parser)
setOutputParser(parser);
......
......@@ -242,6 +242,7 @@ bool MakeStep::init()
pp->setEnvironment(env);
pp->setArguments(args);
pp->resolveAll();
setOutputParser(new ProjectExplorer::GnuMakeParser());
IOutputParser *parser = target()->kit()->createOutputParser();
......
......@@ -289,6 +289,7 @@ bool QMakeStep::init()
pp->setCommand(program.toString());
pp->setArguments(args);
pp->setEnvironment(qt4bc->environment());
pp->resolveAll();
setOutputParser(new QMakeParser);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment