forked from qt-creator/qt-creator
Start on rvct support.
It works, except that the code model doesn't get the rvct include directories and defines yet. And you need to have everything for rvct set up in your environment.
This commit is contained in:
@@ -77,6 +77,8 @@ public:
|
||||
#ifdef QTCREATOR_WITH_S60
|
||||
WINSCW = 5,
|
||||
GCCE = 6,
|
||||
RVCT_ARMV5 = 7,
|
||||
RVCT_ARMV6 = 8,
|
||||
#endif
|
||||
OTHER = 200,
|
||||
UNKNOWN = 201,
|
||||
|
||||
@@ -30,8 +30,6 @@
|
||||
#include "gccetoolchain.h"
|
||||
#include "qt4project.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <QtCore/QDir>
|
||||
#include <QtDebug>
|
||||
|
||||
@@ -58,11 +56,13 @@ ToolChain::ToolChainType GCCEToolChain::type() const
|
||||
|
||||
QList<HeaderPath> GCCEToolChain::systemHeaderPaths()
|
||||
{
|
||||
GccToolChain::systemHeaderPaths();
|
||||
m_systemHeaderPaths.append(HeaderPath(QString("%1\\epoc32\\include").arg(m_deviceRoot), HeaderPath::GlobalHeaderPath));
|
||||
m_systemHeaderPaths.append(HeaderPath(QString("%1\\epoc32\\include\\stdapis").arg(m_deviceRoot), HeaderPath::GlobalHeaderPath));
|
||||
m_systemHeaderPaths.append(HeaderPath(QString("%1\\epoc32\\include\\stdapis\\sys").arg(m_deviceRoot), HeaderPath::GlobalHeaderPath));
|
||||
m_systemHeaderPaths.append(HeaderPath(QString("%1\\epoc32\\include\\variant").arg(m_deviceRoot), HeaderPath::GlobalHeaderPath));
|
||||
if (m_systemHeaderPaths.isEmpty()) {
|
||||
GccToolChain::systemHeaderPaths();
|
||||
m_systemHeaderPaths.append(HeaderPath(QString("%1\\epoc32\\include").arg(m_deviceRoot), HeaderPath::GlobalHeaderPath));
|
||||
m_systemHeaderPaths.append(HeaderPath(QString("%1\\epoc32\\include\\stdapis").arg(m_deviceRoot), HeaderPath::GlobalHeaderPath));
|
||||
m_systemHeaderPaths.append(HeaderPath(QString("%1\\epoc32\\include\\stdapis\\sys").arg(m_deviceRoot), HeaderPath::GlobalHeaderPath));
|
||||
m_systemHeaderPaths.append(HeaderPath(QString("%1\\epoc32\\include\\variant").arg(m_deviceRoot), HeaderPath::GlobalHeaderPath));
|
||||
}
|
||||
return m_systemHeaderPaths;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
SUPPORT_QT_S60 = $$(QTCREATOR_WITH_S60)
|
||||
!isEmpty(SUPPORT_QT_S60) {
|
||||
!isEmpty(SUPPORT_QT_S60) {
|
||||
message("Adding experimental support for Qt/S60 applications.")
|
||||
DEFINES += QTCREATOR_WITH_S60
|
||||
SOURCES += $$PWD/s60devices.cpp \
|
||||
@@ -9,7 +9,8 @@ SUPPORT_QT_S60 = $$(QTCREATOR_WITH_S60)
|
||||
$$PWD/gccetoolchain.cpp \
|
||||
$$PWD/s60emulatorrunconfiguration.cpp \
|
||||
$$PWD/s60devicerunconfiguration.cpp \
|
||||
$$PWD/serialdevicelister.cpp
|
||||
$$PWD/serialdevicelister.cpp \
|
||||
$$PWD/rvcttoolchain.cpp
|
||||
HEADERS += $$PWD/s60devices.h \
|
||||
$$PWD/s60devicespreferencepane.h \
|
||||
$$PWD/s60manager.h \
|
||||
@@ -17,10 +18,9 @@ SUPPORT_QT_S60 = $$(QTCREATOR_WITH_S60)
|
||||
$$PWD/gccetoolchain.h \
|
||||
$$PWD/s60emulatorrunconfiguration.h \
|
||||
$$PWD/s60devicerunconfiguration.h \
|
||||
$$PWD/serialdevicelister.h
|
||||
$$PWD/serialdevicelister.h \
|
||||
$$PWD/rvcttoolchain.h
|
||||
FORMS += $$PWD/s60devicespreferencepane.ui
|
||||
OTHER_FILES += $$PWD/qt-s60-todo.txt
|
||||
|
||||
include($$PWD/../../../../tests/manual/trk/trklauncher.pri) || error("could not include trklauncher.pri")
|
||||
# LIBS += -lUser32 -lSetupApi
|
||||
include($$PWD/../../../../tests/manual/trk/trklauncher.pri)||error("could not include trklauncher.pri")
|
||||
}
|
||||
|
||||
106
src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp
Normal file
106
src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp
Normal file
@@ -0,0 +1,106 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** Commercial Usage
|
||||
**
|
||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||
** accordance with the Qt Commercial License Agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Nokia.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** If you are unsure which license is appropriate for your use, please
|
||||
** contact the sales department at http://www.qtsoftware.com/contact.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "rvcttoolchain.h"
|
||||
|
||||
#include "qt4project.h"
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
|
||||
RVCTToolChain::RVCTToolChain(S60Devices::Device device, ToolChain::ToolChainType type,
|
||||
const QString &makeTargetBase)
|
||||
: m_deviceId(device.id),
|
||||
m_deviceName(device.name),
|
||||
m_deviceRoot(device.epocRoot),
|
||||
m_type(type),
|
||||
m_makeTargetBase(makeTargetBase)
|
||||
{
|
||||
}
|
||||
|
||||
ToolChain::ToolChainType RVCTToolChain::type() const
|
||||
{
|
||||
return m_type;
|
||||
}
|
||||
|
||||
QByteArray RVCTToolChain::predefinedMacros()
|
||||
{
|
||||
//TODO
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
QList<HeaderPath> RVCTToolChain::systemHeaderPaths()
|
||||
{
|
||||
if (m_systemHeaderPaths.isEmpty()) {
|
||||
//TODO system header paths (from environment variables?)
|
||||
m_systemHeaderPaths.append(HeaderPath(QString("%1\\epoc32\\include").arg(m_deviceRoot), HeaderPath::GlobalHeaderPath));
|
||||
m_systemHeaderPaths.append(HeaderPath(QString("%1\\epoc32\\include\\stdapis").arg(m_deviceRoot), HeaderPath::GlobalHeaderPath));
|
||||
m_systemHeaderPaths.append(HeaderPath(QString("%1\\epoc32\\include\\stdapis\\sys").arg(m_deviceRoot), HeaderPath::GlobalHeaderPath));
|
||||
m_systemHeaderPaths.append(HeaderPath(QString("%1\\epoc32\\include\\variant").arg(m_deviceRoot), HeaderPath::GlobalHeaderPath));
|
||||
}
|
||||
return m_systemHeaderPaths;
|
||||
}
|
||||
|
||||
void RVCTToolChain::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 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()
|
||||
&& m_deviceId == static_cast<RVCTToolChain *>(other)->m_deviceId
|
||||
&& m_deviceName == static_cast<RVCTToolChain *>(other)->m_deviceName);
|
||||
}
|
||||
|
||||
void RVCTToolChain::setProject(const ProjectExplorer::Project *project)
|
||||
{
|
||||
m_project = project;
|
||||
}
|
||||
71
src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h
Normal file
71
src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h
Normal file
@@ -0,0 +1,71 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** Commercial Usage
|
||||
**
|
||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||
** accordance with the Qt Commercial License Agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Nokia.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** If you are unsure which license is appropriate for your use, please
|
||||
** contact the sales department at http://www.qtsoftware.com/contact.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef RVCTTOOLCHAIN_H
|
||||
#define RVCTTOOLCHAIN_H
|
||||
|
||||
#include "s60devices.h"
|
||||
|
||||
#include <projectexplorer/toolchain.h>
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
class RVCTToolChain : public ProjectExplorer::ToolChain
|
||||
{
|
||||
public:
|
||||
RVCTToolChain(S60Devices::Device device, ProjectExplorer::ToolChain::ToolChainType type,
|
||||
const QString &makeTargetBase);
|
||||
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;
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Qt4ProjectManager
|
||||
|
||||
#endif // RVCTTOOLCHAIN_H
|
||||
@@ -82,7 +82,7 @@ bool S60DeviceRunConfiguration::isEnabled() const
|
||||
Qt4Project *pro = qobject_cast<Qt4Project*>(project());
|
||||
QTC_ASSERT(pro, return false);
|
||||
ToolChain::ToolChainType type = pro->toolChainType(pro->activeBuildConfiguration());
|
||||
return type == ToolChain::GCCE; //TODO || type == ToolChain::ARMV5
|
||||
return type == ToolChain::GCCE || type == ToolChain::RVCT_ARMV5 || type == ToolChain::RVCT_ARMV6;
|
||||
}
|
||||
|
||||
QWidget *S60DeviceRunConfiguration::configurationWidget()
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "s60devicespreferencepane.h"
|
||||
#include "winscwtoolchain.h"
|
||||
#include "gccetoolchain.h"
|
||||
#include "rvcttoolchain.h"
|
||||
#include "s60emulatorrunconfiguration.h"
|
||||
#include "s60Devicerunconfiguration.h"
|
||||
|
||||
@@ -156,6 +157,23 @@ ProjectExplorer::ToolChain *S60Manager::createGCCEToolChain(const Qt4ProjectMana
|
||||
return new GCCEToolChain(deviceForQtVersion(version));
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
S60Devices::Device S60Manager::deviceForQtVersion(const Qt4ProjectManager::QtVersion *version) const
|
||||
{
|
||||
S60Devices::Device device;
|
||||
|
||||
@@ -58,6 +58,8 @@ public:
|
||||
|
||||
ProjectExplorer::ToolChain *createWINSCWToolChain(const Qt4ProjectManager::QtVersion *version) const;
|
||||
ProjectExplorer::ToolChain *createGCCEToolChain(const Qt4ProjectManager::QtVersion *version) const;
|
||||
ProjectExplorer::ToolChain *createRVCTToolChain(const Qt4ProjectManager::QtVersion *version,
|
||||
ProjectExplorer::ToolChain::ToolChainType type) const;
|
||||
|
||||
S60Devices *devices() const { return m_devices; }
|
||||
S60Devices::Device deviceForQtVersion(const Qt4ProjectManager::QtVersion *version) const;
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
|
||||
#ifdef QTCREATOR_WITH_S60
|
||||
#include "qt-s60/gccetoolchain.h"
|
||||
#include "qt-s60/rvcttoolchain.h"
|
||||
#endif
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
@@ -406,6 +407,9 @@ void Qt4Project::updateToolChain(const QString &buildConfiguration) const
|
||||
#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
|
||||
}
|
||||
|
||||
@@ -324,26 +324,32 @@ void Qt4ProjectConfigWidget::updateToolChainCombo()
|
||||
foreach (ProjectExplorer::ToolChain::ToolChainType toolchain, toolchains) {
|
||||
switch (toolchain) {
|
||||
case ProjectExplorer::ToolChain::GCC:
|
||||
m_ui->toolChainComboBox->addItem(tr("gcc"), qVariantFromValue(ProjectExplorer::ToolChain::GCC));
|
||||
m_ui->toolChainComboBox->addItem(tr("gcc"), qVariantFromValue(toolchain));
|
||||
break;
|
||||
case ProjectExplorer::ToolChain::LinuxICC:
|
||||
m_ui->toolChainComboBox->addItem(tr("icc"), qVariantFromValue(ProjectExplorer::ToolChain::LinuxICC));
|
||||
m_ui->toolChainComboBox->addItem(tr("icc"), qVariantFromValue(toolchain));
|
||||
break;
|
||||
case ProjectExplorer::ToolChain::MinGW:
|
||||
m_ui->toolChainComboBox->addItem(tr("mingw"), qVariantFromValue(ProjectExplorer::ToolChain::MinGW));
|
||||
m_ui->toolChainComboBox->addItem(tr("mingw"), qVariantFromValue(toolchain));
|
||||
break;
|
||||
case ProjectExplorer::ToolChain::MSVC:
|
||||
m_ui->toolChainComboBox->addItem(tr("msvc"), qVariantFromValue(ProjectExplorer::ToolChain::MSVC));
|
||||
m_ui->toolChainComboBox->addItem(tr("msvc"), qVariantFromValue(toolchain));
|
||||
break;
|
||||
case ProjectExplorer::ToolChain::WINCE:
|
||||
m_ui->toolChainComboBox->addItem(tr("wince"), qVariantFromValue(ProjectExplorer::ToolChain::WINCE));
|
||||
m_ui->toolChainComboBox->addItem(tr("wince"), qVariantFromValue(toolchain));
|
||||
break;
|
||||
#ifdef QTCREATOR_WITH_S60
|
||||
case ProjectExplorer::ToolChain::WINSCW:
|
||||
m_ui->toolChainComboBox->addItem(tr("winscw"), qVariantFromValue(ProjectExplorer::ToolChain::WINSCW));
|
||||
m_ui->toolChainComboBox->addItem(tr("winscw"), qVariantFromValue(toolchain));
|
||||
break;
|
||||
case ProjectExplorer::ToolChain::GCCE:
|
||||
m_ui->toolChainComboBox->addItem(tr("gcce"), qVariantFromValue(ProjectExplorer::ToolChain::GCCE));
|
||||
m_ui->toolChainComboBox->addItem(tr("gcce"), qVariantFromValue(toolchain));
|
||||
break;
|
||||
case ProjectExplorer::ToolChain::RVCT_ARMV5:
|
||||
m_ui->toolChainComboBox->addItem(tr("rvct - armv5"), qVariantFromValue(toolchain));
|
||||
break;
|
||||
case ProjectExplorer::ToolChain::RVCT_ARMV6:
|
||||
m_ui->toolChainComboBox->addItem(tr("rvct - armv6"), qVariantFromValue(toolchain));
|
||||
break;
|
||||
#endif
|
||||
case ProjectExplorer::ToolChain::OTHER:
|
||||
|
||||
@@ -100,7 +100,10 @@ bool Qt4RunConfiguration::isEnabled() const
|
||||
Qt4Project *pro = qobject_cast<Qt4Project*>(project());
|
||||
QTC_ASSERT(pro, return false);
|
||||
ProjectExplorer::ToolChain::ToolChainType type = pro->toolChainType(pro->activeBuildConfiguration());
|
||||
return type != ProjectExplorer::ToolChain::WINSCW && type != ProjectExplorer::ToolChain::GCCE;
|
||||
return type != ProjectExplorer::ToolChain::WINSCW
|
||||
&& type != ProjectExplorer::ToolChain::GCCE
|
||||
&& type != ProjectExplorer::ToolChain::RVCT_ARMV5
|
||||
&& type != ProjectExplorer::ToolChain::RVCT_ARMV6;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
|
||||
@@ -997,6 +997,9 @@ ProjectExplorer::ToolChain *QtVersion::createToolChain(ProjectExplorer::ToolChai
|
||||
tempToolchain = S60Manager::instance()->createWINSCWToolChain(this);
|
||||
} else if (type == ProjectExplorer::ToolChain::GCCE) {
|
||||
tempToolchain = S60Manager::instance()->createGCCEToolChain(this);
|
||||
} else if (type == ProjectExplorer::ToolChain::RVCT_ARMV5
|
||||
|| type == ProjectExplorer::ToolChain::RVCT_ARMV6) {
|
||||
tempToolchain = S60Manager::instance()->createRVCTToolChain(this, type);
|
||||
#endif
|
||||
} else {
|
||||
qDebug()<<"Could not create ToolChain for"<<mkspec();
|
||||
@@ -1087,7 +1090,10 @@ QList<ProjectExplorer::ToolChain::ToolChainType> QtVersion::possibleToolChainTyp
|
||||
toolChains << ProjectExplorer::ToolChain::LinuxICC;
|
||||
#ifdef QTCREATOR_WITH_S60
|
||||
else if (spec.contains("symbian-abld"))
|
||||
toolChains << ProjectExplorer::ToolChain::GCCE << ProjectExplorer::ToolChain::WINSCW;
|
||||
toolChains << ProjectExplorer::ToolChain::GCCE
|
||||
<< ProjectExplorer::ToolChain::RVCT_ARMV5
|
||||
<< ProjectExplorer::ToolChain::RVCT_ARMV6
|
||||
<< ProjectExplorer::ToolChain::WINSCW;
|
||||
#endif
|
||||
else
|
||||
toolChains << ProjectExplorer::ToolChain::GCC;
|
||||
|
||||
Reference in New Issue
Block a user