Commit 02fb12d7 authored by con's avatar con
Browse files

Add toolchain for WinScw, and be able to compile for winscw udeb.

parent 3267a917
......@@ -73,6 +73,9 @@ public:
MinGW,
MSVC,
WINCE,
#ifdef QTCREATOR_WITH_S60
WINSCW,
#endif
OTHER,
UNKNOWN,
INVALID
......
* When the refresh button in the SDK option page is pressed
the qtoptionspage is not updated to reflect the new versions
though we update them in S60Manager
* QtVersion:
* support the different tool chains
* WINSCW tool chain:
* predefined macros
* system includes
* get rid of hardcoded carbide path
......@@ -2,14 +2,14 @@ SUPPORT_QT_S60 = $$(QTCREATOR_WITH_S60)
!isEmpty(SUPPORT_QT_S60) {
message("Adding experimental support for Qt/S60 applications.")
DEFINES += QTCREATOR_WITH_S60
SOURCES += $$PWD/s60devices.cpp \
$$PWD/s60devicespreferencepane.cpp \
$$PWD/s60manager.cpp
$$PWD/s60manager.cpp \
$$PWD/winscwtoolchain.cpp
HEADERS += $$PWD/s60devices.h \
$$PWD/s60devicespreferencepane.h \
$$PWD/s60manager.h
$$PWD/s60manager.h \
$$PWD/winscwtoolchain.h
FORMS += $$PWD/s60devicespreferencepane.ui
OTHER_FILES += qt-s60-todo.txt
}
......@@ -129,12 +129,25 @@ QList<S60Devices::Device> S60Devices::devices() const
return m_devices;
}
S60Devices::Device S60Devices::deviceForRoot(const QString &epocRoot) const
S60Devices::Device S60Devices::deviceForId(const QString &id) const
{
foreach (const S60Devices::Device &i, m_devices) {
if (i.epocRoot == epocRoot) {
if (i.id == id) {
return i;
}
}
return Device();
}
QString S60Devices::cleanedRootPath(const QString &deviceRoot)
{
QString path = deviceRoot;
if (path.size() > 1 && path[1] == QChar(':')) {
path = path.mid(2);
}
if (!path.size() || path[path.size()-1] != QChar('\\')) {
path += QChar('\\');
}
return path;
}
......@@ -26,8 +26,9 @@ public:
QString errorString() const;
QList<Device> devices() const;
bool detectQtForDevices();
Device deviceForRoot(const QString &epocRoot) const;
Device deviceForId(const QString &id) const;
static QString cleanedRootPath(const QString &deviceRoot);
signals:
void qtVersionsChanged();
......
......@@ -31,21 +31,26 @@
#include "s60devices.h"
#include "s60devicespreferencepane.h"
#include "qtversionmanager.h"
#include "winscwtoolchain.h"
#include <extensionsystem/pluginmanager.h>
using namespace Qt4ProjectManager::Internal;
S60Manager *S60Manager::m_instance = 0;
namespace {
static const char *S60_AUTODETECTION_SOURCE = "QTS60";
}
S60Manager *S60Manager::instance() { return m_instance; }
S60Manager::S60Manager(QObject *parent)
: QObject(parent),
m_devices(new S60Devices(this)),
m_devicesPreferencePane(new S60DevicesPreferencePane(m_devices, this))
{
m_instance = this;
m_devices->detectQtForDevices();
ExtensionSystem::PluginManager::instance()
->addObject(m_devicesPreferencePane);
......@@ -105,3 +110,9 @@ void S60Manager::updateQtVersions()
versionManager->addVersion(version);
}
}
ProjectExplorer::ToolChain *S60Manager::createWINSCWToolChain(const Qt4ProjectManager::QtVersion *version) const
{
QString id = version->autodetectionSource().mid(QString(S60_AUTODETECTION_SOURCE).length()+1);
return new WINSCWToolChain(m_devices->deviceForId(id));
}
......@@ -30,11 +30,15 @@
#ifndef S60MANAGER_H
#define S60MANAGER_H
#include "qtversionmanager.h"
#include <extensionsystem/iplugin.h>
#include <projectexplorer/toolchain.h>
#include <QtCore/QObject>
namespace Qt4ProjectManager {
namespace Internal {
class S60Devices;
......@@ -46,16 +50,20 @@ class S60Manager : public QObject
public:
S60Manager(QObject *parent = 0);
~S60Manager();
static S60Manager *instance();
ProjectExplorer::ToolChain *createWINSCWToolChain(const Qt4ProjectManager::QtVersion *version) const;
private slots:
void updateQtVersions();
private:
static S60Manager *m_instance;
S60Devices *m_devices;
S60DevicesPreferencePane *m_devicesPreferencePane;
};
#endif // S60MANAGER_H
} // namespace Internal
} // namespace Qt4ProjectManager
#endif // S60MANAGER_H
#include "winscwtoolchain.h"
using namespace ProjectExplorer;
using namespace Qt4ProjectManager::Internal;
WINSCWToolChain::WINSCWToolChain(S60Devices::Device device)
// TODO get rid of hardcoded carbide path
: m_carbidePath(QLatin1String("C:\\Apps\\Nokia\\Carbide.c++ v2.0")),
m_deviceId(device.id),
m_deviceName(device.name),
m_deviceRoot(device.epocRoot)
{
}
ToolChain::ToolChainType WINSCWToolChain::type() const
{
return ToolChain::WINSCW;
}
QByteArray WINSCWToolChain::predefinedMacros()
{
// TODO
return m_predefinedMacros;
}
QList<HeaderPath> WINSCWToolChain::systemHeaderPaths()
{
// TODO
return m_systemHeaderPaths;
}
void WINSCWToolChain::addToEnvironment(ProjectExplorer::Environment &env)
{
QStringList symIncludes = QStringList()
<< "\\MSL\\MSL_C\\MSL_Common\\Include"
<< "\\MSL\\MSL_C\\MSL_Win32\\Include"
<< "\\MSL\\MSL_CMSL_X86"
<< "\\MSL\\MSL_C++\\MSL_Common\\Include"
<< "\\MSL\\MSL_Extras\\MSL_Common\\Include"
<< "\\MSL\\MSL_Extras\\MSL_Win32\\Include"
<< "\\Win32-x86 Support\\Headers\\Win32 SDK";
for (int i = 0; i < symIncludes.size(); ++i)
symIncludes[i].prepend(QString("%1\\x86Build\\Symbian_Support").arg(m_carbidePath));
env.set("MWCSYM2INCLUDES", symIncludes.join(";"));
QStringList symLibraries = QStringList()
<< "\\Win32-x86 Support\\Libraries\\Win32 SDK"
<< "\\Runtime\\Runtime_x86\\Runtime_Win32\\Libs";
for (int i = 0; i < symLibraries.size(); ++i)
symLibraries[i].prepend(QString("%1\\x86Build\\Symbian_Support").arg(m_carbidePath));
env.set("MWSYM2LIBRARIES", symLibraries.join(";"));
env.set("MWSYM2LIBRARYFILES", "MSL_All_MSE_Symbian_D.lib;gdi32.lib;user32.lib;kernel32.lib");
env.prependOrSetPath(QString("%1\\x86Build\\Symbian_Tools\\Command_Line_Tools").arg(m_carbidePath)); // compiler
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 WINSCWToolChain::makeCommand() const
{
return "make";
}
bool WINSCWToolChain::equals(ToolChain *other) const
{
return (m_deviceId == static_cast<WINSCWToolChain *>(other)->m_deviceId
&& m_deviceName == static_cast<WINSCWToolChain *>(other)->m_deviceName);
}
#ifndef WINSCWTOOLCHAIN_H
#define WINSCWTOOLCHAIN_H
#include "s60devices.h"
#include <projectexplorer/toolchain.h>
namespace Qt4ProjectManager {
namespace Internal {
class WINSCWToolChain : public ProjectExplorer::ToolChain
{
public:
WINSCWToolChain(S60Devices::Device device);
QByteArray predefinedMacros();
QList<ProjectExplorer::HeaderPath> systemHeaderPaths();
void addToEnvironment(ProjectExplorer::Environment &env);
ProjectExplorer::ToolChain::ToolChainType type() const;
QString makeCommand() const;
protected:
bool equals(ToolChain *other) const;
private:
QString m_carbidePath;
QString m_deviceId;
QString m_deviceName;
QString m_deviceRoot;
QByteArray m_predefinedMacros;
QList<ProjectExplorer::HeaderPath> m_systemHeaderPaths;
};
} // namespace Internal
} // namespace Qt4ProjectManager
#endif // WINSCWTOOLCHAIN_H
......@@ -32,6 +32,10 @@
#include "qt4projectmanagerconstants.h"
#include "profilereader.h"
#ifdef QTCREATOR_WITH_S60
#include "qt-s60/s60manager.h"
#endif
#include <projectexplorer/debugginghelper.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/cesdkhandler.h>
......@@ -913,6 +917,10 @@ void QtVersion::updateToolChain() const
}
m_test = ProjectExplorer::ToolChain::createGccToolChain(qmake_cxx);
//qDebug()<<"GCC ToolChain ("<<qmake_cxx<<")";
#ifdef QTCREATOR_WITH_S60
} else if (t == ProjectExplorer::ToolChain::WINSCW) {
m_test = S60Manager::instance()->createWINSCWToolChain(this);
#endif
} else {
qDebug()<<"Could not detect ToolChain for"<<mkspec();
qDebug()<<"Qt Creator doesn't know about the system includes, nor the systems defines.";
......@@ -1007,6 +1015,8 @@ ProjectExplorer::ToolChain::ToolChainType QtVersion::toolchainType() const
return ProjectExplorer::ToolChain::WINCE;
else if (spec.contains("linux-icc"))
return ProjectExplorer::ToolChain::LinuxICC;
else if (spec.contains("abld"))
return ProjectExplorer::ToolChain::WINSCW;
else
return ProjectExplorer::ToolChain::GCC;
}
......
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