forked from qt-creator/qt-creator
Remove dependency of rvct toolchain and gcce toolchain on qt4project.
Also makes the code a lot smaller.
This commit is contained in:
@@ -93,7 +93,6 @@ public:
|
||||
virtual void addToEnvironment(ProjectExplorer::Environment &env) = 0;
|
||||
virtual ToolChainType type() const = 0;
|
||||
virtual QString makeCommand() const = 0;
|
||||
virtual QString defaultMakeTarget() const = 0;
|
||||
|
||||
ToolChain();
|
||||
virtual ~ToolChain();
|
||||
@@ -122,7 +121,6 @@ public:
|
||||
virtual void addToEnvironment(ProjectExplorer::Environment &env);
|
||||
virtual ToolChainType type() const;
|
||||
virtual QString makeCommand() const;
|
||||
virtual QString defaultMakeTarget() const { return ""; }
|
||||
|
||||
protected:
|
||||
virtual bool equals(ToolChain *other) const;
|
||||
@@ -156,7 +154,6 @@ public:
|
||||
virtual void addToEnvironment(ProjectExplorer::Environment &env);
|
||||
virtual ToolChainType type() const;
|
||||
virtual QString makeCommand() const;
|
||||
virtual QString defaultMakeTarget() const { return ""; }
|
||||
protected:
|
||||
virtual bool equals(ToolChain *other) const;
|
||||
QString m_name;
|
||||
|
@@ -80,27 +80,9 @@ QString GCCEToolChain::makeCommand() const
|
||||
return "make";
|
||||
}
|
||||
|
||||
QString GCCEToolChain::defaultMakeTarget() const
|
||||
{
|
||||
const Qt4Project *qt4project = qobject_cast<const Qt4Project *>(m_project);
|
||||
if (qt4project) {
|
||||
if (!(QtVersion::QmakeBuildConfig(qt4project->value(
|
||||
qt4project->activeBuildConfiguration(),
|
||||
"buildConfiguration").toInt()) & QtVersion::DebugBuild)) {
|
||||
return "release-gcce";
|
||||
}
|
||||
}
|
||||
return "debug-gcce";
|
||||
}
|
||||
|
||||
bool GCCEToolChain::equals(ToolChain *other) const
|
||||
{
|
||||
return (other->type() == type()
|
||||
&& m_deviceId == static_cast<GCCEToolChain *>(other)->m_deviceId
|
||||
&& m_deviceName == static_cast<GCCEToolChain *>(other)->m_deviceName);
|
||||
}
|
||||
|
||||
void GCCEToolChain::setProject(const ProjectExplorer::Project *project)
|
||||
{
|
||||
m_project = project;
|
||||
}
|
||||
|
@@ -32,7 +32,6 @@
|
||||
|
||||
#include "s60devices.h"
|
||||
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
@@ -46,10 +45,6 @@ public:
|
||||
void addToEnvironment(ProjectExplorer::Environment &env);
|
||||
ProjectExplorer::ToolChain::ToolChainType type() const;
|
||||
QString makeCommand() const;
|
||||
QString defaultMakeTarget() const;
|
||||
|
||||
void setProject(const ProjectExplorer::Project *project);
|
||||
|
||||
protected:
|
||||
bool equals(ToolChain *other) const;
|
||||
|
||||
@@ -57,7 +52,6 @@ private:
|
||||
QString m_deviceId;
|
||||
QString m_deviceName;
|
||||
QString m_deviceRoot;
|
||||
const ProjectExplorer::Project *m_project;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -28,20 +28,17 @@
|
||||
**************************************************************************/
|
||||
|
||||
#include "rvcttoolchain.h"
|
||||
|
||||
#include "qt4project.h"
|
||||
#include <QtCore/QProcess>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
|
||||
RVCTToolChain::RVCTToolChain(S60Devices::Device device, ToolChain::ToolChainType type,
|
||||
const QString &makeTargetBase)
|
||||
RVCTToolChain::RVCTToolChain(S60Devices::Device device, ToolChain::ToolChainType type)
|
||||
: m_versionUpToDate(false),
|
||||
m_deviceId(device.id),
|
||||
m_deviceName(device.name),
|
||||
m_deviceRoot(device.epocRoot),
|
||||
m_type(type),
|
||||
m_makeTargetBase(makeTargetBase)
|
||||
m_type(type)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -132,19 +129,6 @@ QString RVCTToolChain::makeCommand() const
|
||||
return "make";
|
||||
}
|
||||
|
||||
QString RVCTToolChain::defaultMakeTarget() const
|
||||
{
|
||||
const Qt4Project *qt4project = qobject_cast<const Qt4Project *>(m_project);
|
||||
if (qt4project) {
|
||||
if (!(QtVersion::QmakeBuildConfig(qt4project->value(
|
||||
qt4project->activeBuildConfiguration(),
|
||||
"buildConfiguration").toInt()) & QtVersion::DebugBuild)) {
|
||||
return QString::fromLocal8Bit("release-%1").arg(m_makeTargetBase);
|
||||
}
|
||||
}
|
||||
return QString::fromLocal8Bit("debug-%1").arg(m_makeTargetBase);
|
||||
}
|
||||
|
||||
bool RVCTToolChain::equals(ToolChain *other) const
|
||||
{
|
||||
return (other->type() == type()
|
||||
@@ -152,7 +136,3 @@ bool RVCTToolChain::equals(ToolChain *other) const
|
||||
&& m_deviceName == static_cast<RVCTToolChain *>(other)->m_deviceName);
|
||||
}
|
||||
|
||||
void RVCTToolChain::setProject(const ProjectExplorer::Project *project)
|
||||
{
|
||||
m_project = project;
|
||||
}
|
||||
|
@@ -40,17 +40,12 @@ namespace Internal {
|
||||
class RVCTToolChain : public ProjectExplorer::ToolChain
|
||||
{
|
||||
public:
|
||||
RVCTToolChain(S60Devices::Device device, ProjectExplorer::ToolChain::ToolChainType type,
|
||||
const QString &makeTargetBase);
|
||||
RVCTToolChain(S60Devices::Device device, ProjectExplorer::ToolChain::ToolChainType type);
|
||||
virtual QByteArray predefinedMacros();
|
||||
QList<ProjectExplorer::HeaderPath> systemHeaderPaths();
|
||||
void addToEnvironment(ProjectExplorer::Environment &env);
|
||||
ProjectExplorer::ToolChain::ToolChainType type() const;
|
||||
QString makeCommand() const;
|
||||
QString defaultMakeTarget() const;
|
||||
|
||||
void setProject(const ProjectExplorer::Project *project);
|
||||
|
||||
protected:
|
||||
bool equals(ToolChain *other) const;
|
||||
|
||||
@@ -64,9 +59,7 @@ private:
|
||||
QString m_deviceId;
|
||||
QString m_deviceName;
|
||||
QString m_deviceRoot;
|
||||
const ProjectExplorer::Project *m_project;
|
||||
ProjectExplorer::ToolChain::ToolChainType m_type;
|
||||
QString m_makeTargetBase;
|
||||
QByteArray m_predefinedMacros;
|
||||
QList<ProjectExplorer::HeaderPath> m_systemHeaderPaths;
|
||||
};
|
||||
|
@@ -160,18 +160,7 @@ ProjectExplorer::ToolChain *S60Manager::createGCCEToolChain(const Qt4ProjectMana
|
||||
ProjectExplorer::ToolChain *S60Manager::createRVCTToolChain(const Qt4ProjectManager::QtVersion *version,
|
||||
ProjectExplorer::ToolChain::ToolChainType type) const
|
||||
{
|
||||
QString makeTargetBase;
|
||||
switch (type) {
|
||||
case ProjectExplorer::ToolChain::RVCT_ARMV5:
|
||||
makeTargetBase = "armv5";
|
||||
break;
|
||||
case ProjectExplorer::ToolChain::RVCT_ARMV6:
|
||||
makeTargetBase = "armv6";
|
||||
break;
|
||||
default:
|
||||
makeTargetBase = "InternalError";
|
||||
}
|
||||
return new RVCTToolChain(deviceForQtVersion(version), type, makeTargetBase);
|
||||
return new RVCTToolChain(deviceForQtVersion(version), type);
|
||||
}
|
||||
|
||||
S60Devices::Device S60Manager::deviceForQtVersion(const Qt4ProjectManager::QtVersion *version) const
|
||||
|
@@ -113,11 +113,6 @@ QString WINSCWToolChain::makeCommand() const
|
||||
return "make";
|
||||
}
|
||||
|
||||
QString WINSCWToolChain::defaultMakeTarget() const
|
||||
{
|
||||
return "debug-winscw";
|
||||
}
|
||||
|
||||
bool WINSCWToolChain::equals(ToolChain *other) const
|
||||
{
|
||||
return (other->type() == type()
|
||||
|
@@ -47,7 +47,6 @@ public:
|
||||
void addToEnvironment(ProjectExplorer::Environment &env);
|
||||
ProjectExplorer::ToolChain::ToolChainType type() const;
|
||||
QString makeCommand() const;
|
||||
QString defaultMakeTarget() const;
|
||||
|
||||
protected:
|
||||
bool equals(ToolChain *other) const;
|
||||
|
@@ -404,14 +404,6 @@ void Qt4Project::updateToolChain(const QString &buildConfiguration) const
|
||||
} else {
|
||||
delete tempToolChain;
|
||||
}
|
||||
#ifdef QTCREATOR_WITH_S60
|
||||
if (m_toolChain && m_toolChain->type() == ToolChain::GCCE) {
|
||||
static_cast<GCCEToolChain *>(m_toolChain)->setProject(this);
|
||||
} else if (m_toolChain && (m_toolChain->type() == ToolChain::RVCT_ARMV5
|
||||
|| m_toolChain->type() == ToolChain::RVCT_ARMV6)) {
|
||||
static_cast<RVCTToolChain *>(m_toolChain)->setProject(this);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
QString Qt4Project::makeCommand(const QString &buildConfiguration) const
|
||||
@@ -422,8 +414,25 @@ QString Qt4Project::makeCommand(const QString &buildConfiguration) const
|
||||
|
||||
QString Qt4Project::defaultMakeTarget(const QString &buildConfiguration) const
|
||||
{
|
||||
#ifdef QTCREATOR_WITH_S60
|
||||
ToolChain *tc = toolChain(buildConfiguration);
|
||||
return tc ? tc->defaultMakeTarget() : "";
|
||||
if (!tc)
|
||||
return QString::null;
|
||||
QtVersion::QmakeBuildConfig buildConfig
|
||||
= QtVersion::QmakeBuildConfig(value(activeBuildConfiguration(), "buildConfiguration").toInt());
|
||||
|
||||
if (tc->type() == ToolChain::GCCE) {
|
||||
if (!(buildConfig & QtVersion::DebugBuild)) {
|
||||
return "release-gcce";
|
||||
}
|
||||
return "debug-gcce";
|
||||
} else if (tc->type() == ToolChain::RVCT_ARMV5) {
|
||||
return (buildConfig & QtVersion::DebugBuild ? "debug-" : "release-") + QLatin1String("armv5");
|
||||
} else if (tc->type() == ToolChain::RVCT_ARMV6) {
|
||||
return (buildConfig & QtVersion::DebugBuild ? "debug-" : "release-") + QLatin1String("armv6");
|
||||
}
|
||||
#endif
|
||||
return QString::null;
|
||||
}
|
||||
|
||||
void Qt4Project::updateCodeModel()
|
||||
|
Reference in New Issue
Block a user