Commit 655a1c91 authored by con's avatar con
Browse files

Create a wingcce toolchain.

parent 6b3ef9f8
...@@ -100,7 +100,9 @@ QStringList ToolChain::supportedToolChains() ...@@ -100,7 +100,9 @@ QStringList ToolChain::supportedToolChains()
return QStringList() << QLatin1String("gcc") return QStringList() << QLatin1String("gcc")
<< QLatin1String("mingw") << QLatin1String("mingw")
<< QLatin1String("msvc") << QLatin1String("msvc")
<< QLatin1String("wince"); << QLatin1String("wince")
<< QLatin1String("winscw")
<< QLatin1String("gcce");
} }
QString ToolChain::toolChainName(ToolChainType tc) QString ToolChain::toolChainName(ToolChainType tc)
......
...@@ -75,6 +75,7 @@ public: ...@@ -75,6 +75,7 @@ public:
WINCE, WINCE,
#ifdef QTCREATOR_WITH_S60 #ifdef QTCREATOR_WITH_S60
WINSCW, WINSCW,
GCCE,
#endif #endif
OTHER, OTHER,
UNKNOWN, UNKNOWN,
...@@ -86,6 +87,7 @@ public: ...@@ -86,6 +87,7 @@ public:
virtual void addToEnvironment(ProjectExplorer::Environment &env) = 0; virtual void addToEnvironment(ProjectExplorer::Environment &env) = 0;
virtual ToolChainType type() const = 0; virtual ToolChainType type() const = 0;
virtual QString makeCommand() const = 0; virtual QString makeCommand() const = 0;
virtual QString defaultMakeTarget() const = 0;
ToolChain(); ToolChain();
virtual ~ToolChain(); virtual ~ToolChain();
...@@ -115,6 +117,7 @@ public: ...@@ -115,6 +117,7 @@ public:
virtual void addToEnvironment(ProjectExplorer::Environment &env); virtual void addToEnvironment(ProjectExplorer::Environment &env);
virtual ToolChainType type() const; virtual ToolChainType type() const;
virtual QString makeCommand() const; virtual QString makeCommand() const;
virtual QString defaultMakeTarget() const { return ""; }
protected: protected:
virtual bool equals(ToolChain *other) const; virtual bool equals(ToolChain *other) const;
...@@ -148,6 +151,7 @@ public: ...@@ -148,6 +151,7 @@ public:
virtual void addToEnvironment(ProjectExplorer::Environment &env); virtual void addToEnvironment(ProjectExplorer::Environment &env);
virtual ToolChainType type() const; virtual ToolChainType type() const;
virtual QString makeCommand() const; virtual QString makeCommand() const;
virtual QString defaultMakeTarget() const { return ""; }
protected: protected:
virtual bool equals(ToolChain *other) const; virtual bool equals(ToolChain *other) const;
QString m_name; QString m_name;
......
...@@ -68,7 +68,8 @@ bool MakeStep::init(const QString &name) ...@@ -68,7 +68,8 @@ bool MakeStep::init(const QString &name)
workingDirectory = QFileInfo(project()->file()->fileName()).absolutePath(); workingDirectory = QFileInfo(project()->file()->fileName()).absolutePath();
setWorkingDirectory(name, workingDirectory); setWorkingDirectory(name, workingDirectory);
QString makeCmd = qobject_cast<Qt4Project *>(project())->makeCommand(name); Qt4Project *qt4project = qobject_cast<Qt4Project *>(project());
QString makeCmd = qt4project->makeCommand(name);
if (!value(name, "makeCmd").toString().isEmpty()) if (!value(name, "makeCmd").toString().isEmpty())
makeCmd = value(name, "makeCmd").toString(); makeCmd = value(name, "makeCmd").toString();
if (!QFileInfo(makeCmd).isAbsolute()) { if (!QFileInfo(makeCmd).isAbsolute()) {
...@@ -92,6 +93,7 @@ bool MakeStep::init(const QString &name) ...@@ -92,6 +93,7 @@ bool MakeStep::init(const QString &name)
} }
} else { } else {
args = value(name, "makeargs").toStringList(); args = value(name, "makeargs").toStringList();
args << qt4project->defaultMakeTarget(name);
} }
// -w option enables "Enter"/"Leaving directory" messages, which we need for detecting the // -w option enables "Enter"/"Leaving directory" messages, which we need for detecting the
......
#include "gccetoolchain.h"
#include <coreplugin/icore.h>
#include <QtCore/QDir>
#include <QtDebug>
using namespace ProjectExplorer;
using namespace Qt4ProjectManager::Internal;
GCCEToolChain::GCCEToolChain(S60Devices::Device device)
: m_deviceId(device.id),
m_deviceName(device.name),
m_deviceRoot(device.epocRoot)
{
}
ToolChain::ToolChainType GCCEToolChain::type() const
{
return ToolChain::GCCE;
}
QByteArray GCCEToolChain::predefinedMacros()
{
// TODO
return m_predefinedMacros;
}
QList<HeaderPath> GCCEToolChain::systemHeaderPaths()
{
// TODO
return m_systemHeaderPaths;
}
void GCCEToolChain::addToEnvironment(ProjectExplorer::Environment &env)
{
env.prependOrSetPath(QString("%1\\epoc32\\tools").arg(m_deviceRoot)); // e.g. make.exe
env.prependOrSetPath(QString("%1\\epoc32\\gcc\\bin").arg(m_deviceRoot)); // e.g. gcc.exe
env.set("EPOCDEVICE", QString("%1:%2").arg(m_deviceId, m_deviceName));
env.set("EPOCROOT", S60Devices::cleanedRootPath(m_deviceRoot));
}
QString GCCEToolChain::makeCommand() const
{
return "make";
}
QString GCCEToolChain::defaultMakeTarget() const
{
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);
}
#ifndef GCCETOOLCHAIN_H
#define GCCETOOLCHAIN_H
#include "s60devices.h"
#include <projectexplorer/toolchain.h>
namespace Qt4ProjectManager {
namespace Internal {
class GCCEToolChain : public ProjectExplorer::ToolChain
{
public:
GCCEToolChain(S60Devices::Device device);
QByteArray predefinedMacros();
QList<ProjectExplorer::HeaderPath> systemHeaderPaths();
void addToEnvironment(ProjectExplorer::Environment &env);
ProjectExplorer::ToolChain::ToolChainType type() const;
QString makeCommand() const;
QString defaultMakeTarget() const;
protected:
bool equals(ToolChain *other) const;
private:
QString m_deviceId;
QString m_deviceName;
QString m_deviceRoot;
QByteArray m_predefinedMacros;
QList<ProjectExplorer::HeaderPath> m_systemHeaderPaths;
};
} // namespace Internal
} // namespace Qt4ProjectManager
#endif // GCCETOOLCHAIN_H
...@@ -4,9 +4,16 @@ ...@@ -4,9 +4,16 @@
* QtVersion: * QtVersion:
* support the different tool chains * support the different tool chains
* gui for overriding the default make target if necessary,
make arguments --> make options
* more general "debug / release" configuration to be used in toolchain
* WINSCW tool chain: * WINSCW tool chain:
* predefined macros * predefined macros
* system includes * system includes
* GCCE tool chain:
* predefined macros
* system includes
* Run WINSCW executables * Run WINSCW executables
...@@ -5,11 +5,13 @@ SUPPORT_QT_S60 = $$(QTCREATOR_WITH_S60) ...@@ -5,11 +5,13 @@ SUPPORT_QT_S60 = $$(QTCREATOR_WITH_S60)
SOURCES += $$PWD/s60devices.cpp \ SOURCES += $$PWD/s60devices.cpp \
$$PWD/s60devicespreferencepane.cpp \ $$PWD/s60devicespreferencepane.cpp \
$$PWD/s60manager.cpp \ $$PWD/s60manager.cpp \
$$PWD/winscwtoolchain.cpp $$PWD/winscwtoolchain.cpp \
$$PWD/gccetoolchain.cpp
HEADERS += $$PWD/s60devices.h \ HEADERS += $$PWD/s60devices.h \
$$PWD/s60devicespreferencepane.h \ $$PWD/s60devicespreferencepane.h \
$$PWD/s60manager.h \ $$PWD/s60manager.h \
$$PWD/winscwtoolchain.h $$PWD/winscwtoolchain.h \
$$PWD/gccetoolchain.h
FORMS += $$PWD/s60devicespreferencepane.ui FORMS += $$PWD/s60devicespreferencepane.ui
OTHER_FILES += qt-s60-todo.txt OTHER_FILES += qt-s60-todo.txt
} }
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "s60devices.h" #include "s60devices.h"
#include "s60devicespreferencepane.h" #include "s60devicespreferencepane.h"
#include "winscwtoolchain.h" #include "winscwtoolchain.h"
#include "gccetoolchain.h"
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
...@@ -116,3 +117,9 @@ ProjectExplorer::ToolChain *S60Manager::createWINSCWToolChain(const Qt4ProjectMa ...@@ -116,3 +117,9 @@ ProjectExplorer::ToolChain *S60Manager::createWINSCWToolChain(const Qt4ProjectMa
QString id = version->autodetectionSource().mid(QString(S60_AUTODETECTION_SOURCE).length()+1); QString id = version->autodetectionSource().mid(QString(S60_AUTODETECTION_SOURCE).length()+1);
return new WINSCWToolChain(m_devices->deviceForId(id), version->mwcDirectory()); return new WINSCWToolChain(m_devices->deviceForId(id), version->mwcDirectory());
} }
ProjectExplorer::ToolChain *S60Manager::createGCCEToolChain(const Qt4ProjectManager::QtVersion *version) const
{
QString id = version->autodetectionSource().mid(QString(S60_AUTODETECTION_SOURCE).length()+1);
return new GCCEToolChain(m_devices->deviceForId(id));
}
...@@ -53,6 +53,7 @@ public: ...@@ -53,6 +53,7 @@ public:
static S60Manager *instance(); static S60Manager *instance();
ProjectExplorer::ToolChain *createWINSCWToolChain(const Qt4ProjectManager::QtVersion *version) const; ProjectExplorer::ToolChain *createWINSCWToolChain(const Qt4ProjectManager::QtVersion *version) const;
ProjectExplorer::ToolChain *createGCCEToolChain(const Qt4ProjectManager::QtVersion *version) const;
private slots: private slots:
void updateQtVersions(); void updateQtVersions();
......
...@@ -4,7 +4,6 @@ using namespace ProjectExplorer; ...@@ -4,7 +4,6 @@ using namespace ProjectExplorer;
using namespace Qt4ProjectManager::Internal; using namespace Qt4ProjectManager::Internal;
WINSCWToolChain::WINSCWToolChain(S60Devices::Device device, const QString &mwcDirectory) WINSCWToolChain::WINSCWToolChain(S60Devices::Device device, const QString &mwcDirectory)
// TODO get rid of hardcoded carbide path
: m_carbidePath(mwcDirectory), : m_carbidePath(mwcDirectory),
m_deviceId(device.id), m_deviceId(device.id),
m_deviceName(device.name), m_deviceName(device.name),
...@@ -62,8 +61,14 @@ QString WINSCWToolChain::makeCommand() const ...@@ -62,8 +61,14 @@ QString WINSCWToolChain::makeCommand() const
return "make"; return "make";
} }
QString WINSCWToolChain::defaultMakeTarget() const
{
return "debug-winscw";
}
bool WINSCWToolChain::equals(ToolChain *other) const bool WINSCWToolChain::equals(ToolChain *other) const
{ {
return (m_deviceId == static_cast<WINSCWToolChain *>(other)->m_deviceId return (other->type() == type()
&& m_deviceId == static_cast<WINSCWToolChain *>(other)->m_deviceId
&& m_deviceName == static_cast<WINSCWToolChain *>(other)->m_deviceName); && m_deviceName == static_cast<WINSCWToolChain *>(other)->m_deviceName);
} }
...@@ -17,6 +17,7 @@ public: ...@@ -17,6 +17,7 @@ public:
void addToEnvironment(ProjectExplorer::Environment &env); void addToEnvironment(ProjectExplorer::Environment &env);
ProjectExplorer::ToolChain::ToolChainType type() const; ProjectExplorer::ToolChain::ToolChainType type() const;
QString makeCommand() const; QString makeCommand() const;
QString defaultMakeTarget() const;
protected: protected:
bool equals(ToolChain *other) const; bool equals(ToolChain *other) const;
......
...@@ -380,6 +380,11 @@ QString Qt4Project::makeCommand(const QString &buildConfiguration) const ...@@ -380,6 +380,11 @@ QString Qt4Project::makeCommand(const QString &buildConfiguration) const
return qtVersion(buildConfiguration)->toolChain()->makeCommand(); return qtVersion(buildConfiguration)->toolChain()->makeCommand();
} }
QString Qt4Project::defaultMakeTarget(const QString &buildConfiguration) const
{
return qtVersion(buildConfiguration)->toolChain()->defaultMakeTarget();
}
void Qt4Project::updateCodeModel() void Qt4Project::updateCodeModel()
{ {
if (debug) if (debug)
......
...@@ -182,6 +182,7 @@ public: ...@@ -182,6 +182,7 @@ public:
void notifyChanged(const QString &name); void notifyChanged(const QString &name);
QString makeCommand(const QString &buildConfiguration) const; QString makeCommand(const QString &buildConfiguration) const;
QString defaultMakeTarget(const QString &buildConfiguration) const;
// Is called by qmakestep qt4configurationwidget if the settings change // Is called by qmakestep qt4configurationwidget if the settings change
// Informs all Qt4RunConfigurations that their cached values are now invalid // Informs all Qt4RunConfigurations that their cached values are now invalid
......
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