Commit 3a449bda authored by Daniel Teske's avatar Daniel Teske
Browse files

Make Qt4ProjectManager::QMakeStep mulithreading safe

Change-Id: I41abb5e7138351e61c6c9dfc87121837edb21fbe
Reviewed-on: http://codereview.qt-project.org/5452

Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent b96d7b9b
......@@ -80,6 +80,7 @@ const char * const QMAKE_QMLDEBUGLIB_KEY("QtProjectManager.QMakeBuildStep.LinkQm
QMakeStep::QMakeStep(BuildStepList *bsl) :
AbstractProcessStep(bsl, QLatin1String(QMAKE_BS_ID)),
m_forced(false),
m_needToRunQMake(false),
m_linkQmlDebuggingLibrary(DebugLink)
{
ctor();
......@@ -227,8 +228,6 @@ bool QMakeStep::init()
QString program = qtVersion->qmakeCommand();
// Check whether we need to run qmake
m_needToRunQMake = true;
QString makefile = workingDirectory;
if (qt4bc->subNodeBuild()) {
......@@ -244,17 +243,18 @@ bool QMakeStep::init()
makefile.append("/Makefile");
}
// Check whether we need to run qmake
bool makefileOutDated = true;
if (QFileInfo(makefile).exists()) {
QString qmakePath = QtSupport::QtVersionManager::findQMakeBinaryFromMakefile(makefile);
if (qtVersion->qmakeCommand() == qmakePath) {
m_needToRunQMake = !qt4bc->compareToImportFrom(makefile);
makefileOutDated = !qt4bc->compareToImportFrom(makefile);
}
}
if (m_forced) {
m_forced = false;
if (m_forced || makefileOutDated)
m_needToRunQMake = true;
}
m_forced = false;
setEnabled(m_needToRunQMake);
ProcessParameters *pp = processParameters();
......@@ -309,6 +309,7 @@ void QMakeStep::run(QFutureInterface<bool> &fi)
return;
}
m_needToRunQMake = false;
AbstractProcessStep::run(fi);
}
......@@ -334,7 +335,7 @@ bool QMakeStep::immutable() const
void QMakeStep::processStartupFailed()
{
m_forced = true;
m_needToRunQMake = true;
AbstractProcessStep::processStartupFailed();
}
......@@ -342,7 +343,7 @@ bool QMakeStep::processSucceeded(int exitCode, QProcess::ExitStatus status)
{
bool result = AbstractProcessStep::processSucceeded(exitCode, status);
if (!result)
m_forced = true;
m_needToRunQMake = true;
qt4BuildConfiguration()->emitBuildDirectoryInitialized();
return result;
}
......
Supports Markdown
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