Commit 7bec2253 authored by con's avatar con
Browse files

gcce toolchain needs default make target dependent on debug/release.

Passing the Project to the tool chain now. Not quite sure if I like it.
parent 655a1c91
......@@ -31,6 +31,7 @@
#define TOOLCHAIN_H
#include "environment.h"
#include "project.h"
#include <QtCore/QString>
#include <QtCore/QPair>
......@@ -87,7 +88,7 @@ public:
virtual void addToEnvironment(ProjectExplorer::Environment &env) = 0;
virtual ToolChainType type() const = 0;
virtual QString makeCommand() const = 0;
virtual QString defaultMakeTarget() const = 0;
virtual QString defaultMakeTarget(const Project *project) const = 0;
ToolChain();
virtual ~ToolChain();
......@@ -117,7 +118,7 @@ public:
virtual void addToEnvironment(ProjectExplorer::Environment &env);
virtual ToolChainType type() const;
virtual QString makeCommand() const;
virtual QString defaultMakeTarget() const { return ""; }
virtual QString defaultMakeTarget(const Project *) const { return ""; }
protected:
virtual bool equals(ToolChain *other) const;
......@@ -151,7 +152,7 @@ public:
virtual void addToEnvironment(ProjectExplorer::Environment &env);
virtual ToolChainType type() const;
virtual QString makeCommand() const;
virtual QString defaultMakeTarget() const { return ""; }
virtual QString defaultMakeTarget(const Project *) const { return ""; }
protected:
virtual bool equals(ToolChain *other) const;
QString m_name;
......
#include "gccetoolchain.h"
#include "qt4project.h"
#include <coreplugin/icore.h>
......@@ -46,8 +47,16 @@ QString GCCEToolChain::makeCommand() const
return "make";
}
QString GCCEToolChain::defaultMakeTarget() const
QString GCCEToolChain::defaultMakeTarget(const Project *project) const
{
const Qt4Project *qt4project = qobject_cast<const Qt4Project *>(project);
if (qt4project) {
if (!(QtVersion::QmakeBuildConfig(qt4project->qmakeStep()->value(
project->activeBuildConfiguration(),
"buildConfiguration").toInt()) & QtVersion::DebugBuild)) {
return "release-gcce";
}
}
return "debug-gcce";
}
......
......@@ -3,6 +3,7 @@
#include "s60devices.h"
#include <projectexplorer/project.h>
#include <projectexplorer/toolchain.h>
namespace Qt4ProjectManager {
......@@ -17,7 +18,7 @@ public:
void addToEnvironment(ProjectExplorer::Environment &env);
ProjectExplorer::ToolChain::ToolChainType type() const;
QString makeCommand() const;
QString defaultMakeTarget() const;
QString defaultMakeTarget(const ProjectExplorer::Project *project) const;
protected:
bool equals(ToolChain *other) const;
......
......@@ -61,7 +61,7 @@ QString WINSCWToolChain::makeCommand() const
return "make";
}
QString WINSCWToolChain::defaultMakeTarget() const
QString WINSCWToolChain::defaultMakeTarget(const Project *) const
{
return "debug-winscw";
}
......
......@@ -3,6 +3,7 @@
#include "s60devices.h"
#include <projectexplorer/project.h>
#include <projectexplorer/toolchain.h>
namespace Qt4ProjectManager {
......@@ -17,7 +18,7 @@ public:
void addToEnvironment(ProjectExplorer::Environment &env);
ProjectExplorer::ToolChain::ToolChainType type() const;
QString makeCommand() const;
QString defaultMakeTarget() const;
QString defaultMakeTarget(const ProjectExplorer::Project *) const;
protected:
bool equals(ToolChain *other) const;
......
......@@ -382,7 +382,7 @@ QString Qt4Project::makeCommand(const QString &buildConfiguration) const
QString Qt4Project::defaultMakeTarget(const QString &buildConfiguration) const
{
return qtVersion(buildConfiguration)->toolChain()->defaultMakeTarget();
return qtVersion(buildConfiguration)->toolChain()->defaultMakeTarget(this);
}
void Qt4Project::updateCodeModel()
......
......@@ -925,7 +925,7 @@ void QtVersion::updateToolChain() const
//qDebug()<<"GCC ToolChain ("<<qmake_cxx<<")";
#ifdef QTCREATOR_WITH_S60
} else if (t == ProjectExplorer::ToolChain::WINSCW) {
m_test = S60Manager::instance()->createWINSCWToolChain(this);
m_test = S60Manager::instance()->createGCCEToolChain(this);
#endif
} else {
qDebug()<<"Could not detect ToolChain for"<<mkspec();
......
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