#include "gccetoolchain.h" #include "qt4project.h" #include #include #include using namespace ProjectExplorer; using namespace Qt4ProjectManager::Internal; namespace { const char *GCCE_COMMAND = "arm-none-symbianelf-gcc.exe"; } GCCEToolChain::GCCEToolChain(S60Devices::Device device) : GccToolChain(QLatin1String(GCCE_COMMAND)), m_deviceId(device.id), m_deviceName(device.name), m_deviceRoot(device.epocRoot) { } ToolChain::ToolChainType GCCEToolChain::type() const { return ToolChain::GCCE; } QList 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)); return m_systemHeaderPaths; } void GCCEToolChain::addToEnvironment(ProjectExplorer::Environment &env) { // TODO: do we need to set path to gcce? 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 { const Qt4Project *qt4project = qobject_cast(m_project); if (qt4project) { if (!(QtVersion::QmakeBuildConfig(qt4project->qmakeStep()->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(other)->m_deviceId && m_deviceName == static_cast(other)->m_deviceName); } void GCCEToolChain::setProject(const ProjectExplorer::Project *project) { m_project = project; }