Files
qt-creator/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.cpp

117 lines
3.6 KiB
C++
Raw Normal View History

2009-07-20 10:17:30 +02:00
/**************************************************************************
**
** 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
2009-08-14 09:30:56 +02:00
** contact the sales department at http://qt.nokia.com/contact.
2009-07-20 10:17:30 +02:00
**
**************************************************************************/
2009-06-05 16:10:26 +02:00
#include "gccetoolchain.h"
#include "qt4project.h"
2009-06-05 16:10:26 +02:00
#include <utils/qtcassert.h>
2009-06-05 16:10:26 +02:00
#include <QtCore/QDir>
#include <QtCore/QtDebug>
enum { debug = 0 };
2009-06-05 16:10:26 +02:00
using namespace ProjectExplorer;
using namespace Qt4ProjectManager::Internal;
GCCEToolChain::GCCEToolChain(const S60Devices::Device &device,
const QString &gcceCommand,
ProjectExplorer::ToolChain::ToolChainType type) :
GccToolChain(gcceCommand),
m_mixin(device),
m_type(type),
2009-10-29 12:19:56 +01:00
m_gcceCommand(gcceCommand)
2009-06-05 16:10:26 +02:00
{
QTC_ASSERT(m_type == ProjectExplorer::ToolChain::GCCE || m_type == ProjectExplorer::ToolChain::GCCE_GNUPOC, return)
if (debug)
qDebug() << "GCCEToolChain on" << m_type << m_mixin.device();
2009-06-05 16:10:26 +02:00
}
ToolChain::ToolChainType GCCEToolChain::type() const
{
return m_type;
2009-06-05 16:10:26 +02:00
}
QByteArray GCCEToolChain::predefinedMacros()
{
if (m_predefinedMacros.isEmpty()) {
ProjectExplorer::GccToolChain::predefinedMacros();
m_predefinedMacros += "\n"
"#define __GCCE__\n"
"#define __SYMBIAN32__\n";
}
return m_predefinedMacros;
}
2009-06-05 16:10:26 +02:00
QList<HeaderPath> GCCEToolChain::systemHeaderPaths()
{
if (m_systemHeaderPaths.isEmpty()) {
GccToolChain::systemHeaderPaths();
switch (m_type) {
case ProjectExplorer::ToolChain::GCCE:
m_systemHeaderPaths += m_mixin.epocHeaderPaths();
break;
case ProjectExplorer::ToolChain::GCCE_GNUPOC:
m_systemHeaderPaths += m_mixin.gnuPocHeaderPaths();
break;
default:
break;
}
}
2009-06-05 16:10:26 +02:00
return m_systemHeaderPaths;
}
void GCCEToolChain::addToEnvironment(ProjectExplorer::Environment &env)
{
switch (m_type) {
case ProjectExplorer::ToolChain::GCCE:
m_mixin.addEpocToEnvironment(&env);
env.prependOrSetPath(QFileInfo(m_gcceCommand).absolutePath());
case ProjectExplorer::ToolChain::GCCE_GNUPOC:
break;
default:
m_mixin.addGnuPocToEnvironment(&env);
break;
}
2009-06-05 16:10:26 +02:00
}
QString GCCEToolChain::makeCommand() const
{
return QLatin1String("make");
2009-06-05 16:10:26 +02:00
}
bool GCCEToolChain::equals(ToolChain *otherIn) const
2009-06-05 16:10:26 +02:00
{
if (otherIn->type() != type())
return false;
const GCCEToolChain *other = static_cast<const GCCEToolChain *>(otherIn);
return m_mixin == other->m_mixin
&& m_gcceCommand == other->m_gcceCommand;
2009-06-05 16:10:26 +02:00
}