Commit abbfc62f authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Move mkspec policy into the Qt4 targets



For embedded we do not want to override the mkspec as used in the Qt version
since that was most likely tweaked to work with the tool chain selected.

In a generic desktop target we want to be able to switch between different
compilers of the same ABI.

Change-Id: Ib49e54dd15e78c2459b17c552a3c31cb3dce63eb
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent 08dd5fea
......@@ -457,17 +457,7 @@ QString QMakeStep::mkspec()
}
}
QtSupport::BaseQtVersion *version = bc->qtVersion();
// We do not know which abi the Qt version has, so let's stick with the defaults
if (version && version->qtAbis().count() == 1 && version->qtAbis().first().isNull())
return QString();
const QString tcSpec = bc->toolChain() ? bc->toolChain()->mkspec() : QString();
if (!version)
return tcSpec;
if (!tcSpec.isEmpty() && version->hasMkspec(tcSpec))
return tcSpec;
return version->mkspec();
return static_cast<Qt4BaseTarget *>(target())->mkspec(bc);
}
QVariantMap QMakeStep::toMap() const
......
......@@ -310,6 +310,21 @@ ProjectExplorer::ToolChain *Qt4BaseTarget::preferredToolChain(ProjectExplorer::B
return tcs.isEmpty() ? 0 : tcs.at(0);
}
QString Qt4BaseTarget::mkspec(const Qt4BuildConfiguration *bc) const
{
QtSupport::BaseQtVersion *version = bc->qtVersion();
// We do not know which abi the Qt version has, so let's stick with the defaults
if (version && version->qtAbis().count() == 1 && version->qtAbis().first().isNull())
return QString();
const QString tcSpec = bc->toolChain() ? bc->toolChain()->mkspec() : QString();
if (!version)
return tcSpec;
if (!tcSpec.isEmpty() && version->hasMkspec(tcSpec))
return tcSpec;
return version->mkspec();
}
void Qt4BaseTarget::removeUnconfiguredCustomExectutableRunConfigurations()
{
if (runConfigurations().count()) {
......
......@@ -78,12 +78,12 @@ public:
// This is the same for almost all Qt4Targets
// so for now offer a convience function
Qt4BuildConfiguration *addQt4BuildConfiguration(QString defaultDisplayName,
QString displayName,
QtSupport::BaseQtVersion *qtversion,
QtSupport::BaseQtVersion::QmakeBuildConfigs qmakeBuildConfiguration,
QString additionalArguments,
QString directory,
bool importing);
QString displayName,
QtSupport::BaseQtVersion *qtversion,
QtSupport::BaseQtVersion::QmakeBuildConfigs qmakeBuildConfiguration,
QString additionalArguments,
QString directory,
bool importing);
virtual void createApplicationProFiles() = 0;
......@@ -92,6 +92,8 @@ public:
QList<ProjectExplorer::ToolChain *> possibleToolChains(ProjectExplorer::BuildConfiguration *bc) const;
ProjectExplorer::ToolChain *preferredToolChain(ProjectExplorer::BuildConfiguration *) const;
virtual QString mkspec(const Qt4BuildConfiguration *bc) const;
signals:
void buildDirectoryInitialized();
/// emitted if the build configuration changed in a way that
......
......@@ -39,6 +39,7 @@
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qt4projectmanager/qt4nodes.h>
#include <qt4projectmanager/qt4project.h>
#include <qtsupport/baseqtversion.h>
#include <QtCore/QCoreApplication>
......@@ -72,6 +73,14 @@ QList<ProjectExplorer::RunConfiguration *> EmbeddedLinuxTarget::runConfiguration
return result;
}
QString EmbeddedLinuxTarget::mkspec(const Qt4ProjectManager::Qt4BuildConfiguration *bc) const
{
QtSupport::BaseQtVersion *version = bc->qtVersion();
if (!version)
return QString();
return version->mkspec();
}
void EmbeddedLinuxTarget::createApplicationProFiles()
{
removeUnconfiguredCustomExectutableRunConfigurations();
......
......@@ -55,6 +55,8 @@ public:
QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Node *n);
QString mkspec(const Qt4ProjectManager::Qt4BuildConfiguration *bc) const;
private:
Qt4ProjectManager::Qt4BuildConfigurationFactory *m_buildConfigurationFactory;
......
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