forked from qt-creator/qt-creator
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: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -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()) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user