Commit c5b5127b authored by Tobias Hunger's avatar Tobias Hunger

Disable shadow building when appropriate

Reviewed-by: dt
parent 499c3c83
......@@ -136,11 +136,14 @@ bool Qt4BuildConfiguration::fromMap(const QVariantMap &map)
m_qtVersionId = versions.at(0)->uniqueId();
}
if (!qtVersion()->isValid() || !qtVersion()->supportedTargetIds().contains(target()->id())) {
qWarning() << "Buildconfiguration" << displayName() << ": Qt" << qtVersion()->displayName() << "not supported by target" << target()->id();
QtVersion *version = qtVersion();
if (!version->isValid() || !version->supportedTargetIds().contains(target()->id())) {
qWarning() << "Buildconfiguration" << displayName() << ": Qt" << version->displayName() << "not supported by target" << target()->id();
return false;
}
m_shadowBuild = (m_shadowBuild && version->isValid() && version->supportsShadowBuilds());
QList<ToolChain::ToolChainType> possibleTcs(qt4Target()->filterToolChainTypes(qtVersion()->possibleToolChainTypes()));
if (!possibleTcs.contains(toolChainType()))
setToolChainType(qt4Target()->preferredToolChainType(possibleTcs));
......@@ -235,11 +238,14 @@ QString Qt4BuildConfiguration::shadowBuildDirectory() const
void Qt4BuildConfiguration::setShadowBuildAndDirectory(bool shadowBuild, const QString &buildDirectory)
{
if (m_shadowBuild == shadowBuild && m_buildDirectory == buildDirectory)
QtVersion *version = qtVersion();
QString directoryToSet = QDir::fromNativeSeparators(buildDirectory);
bool toSet = (shadowBuild && version->isValid() && version->supportsShadowBuilds());
if (m_shadowBuild == toSet && m_buildDirectory == directoryToSet)
return;
m_shadowBuild = shadowBuild;
m_buildDirectory = buildDirectory;
m_shadowBuild = toSet;
m_buildDirectory = directoryToSet;
emit buildDirectoryChanged();
emit proFileEvaluateNeeded(this);
}
......
......@@ -613,6 +613,28 @@ QString QtVersion::toHtml() const
return rc;
}
bool QtVersion::supportsShadowBuilds() const
{
QSet<QString> targets = supportedTargetIds();
// Symbian does not support shadow building
if (targets.contains(Constants::S60_DEVICE_TARGET_ID) ||
targets.contains(Constants::S60_EMULATOR_TARGET_ID)) {
// We can not support shadow building with the ABLD system
return false;
}
if (targets.contains(Constants::MAEMO_DEVICE_TARGET_ID)) {
#if defined(Q_OS_WIN)
// qmake -unix fails with shadow building on windows
return false;
#else
// ... but works fine anywhere else
return true;
#endif
}
return true;
}
QString QtVersion::displayName() const
{
return m_displayName;
......
......@@ -136,6 +136,9 @@ public:
QmakeBuildConfigs defaultBuildConfig() const;
QString toHtml() const;
bool supportsShadowBuilds() const;
private:
QList<QSharedPointer<ProjectExplorer::ToolChain> > toolChains() const;
static int getUniqueId();
......
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