forked from qt-creator/qt-creator
Toolchain: Add "sysroot" feature.
Reviewed-by: Tobias Hunger
This commit is contained in:
@@ -84,6 +84,7 @@ public:
|
|||||||
virtual ToolChainType type() const = 0;
|
virtual ToolChainType type() const = 0;
|
||||||
virtual QString makeCommand() const = 0;
|
virtual QString makeCommand() const = 0;
|
||||||
virtual IOutputParser *outputParser() const = 0;
|
virtual IOutputParser *outputParser() const = 0;
|
||||||
|
virtual QString sysroot() const { return QString(); }
|
||||||
|
|
||||||
ToolChain();
|
ToolChain();
|
||||||
virtual ~ToolChain();
|
virtual ~ToolChain();
|
||||||
|
|||||||
@@ -597,10 +597,10 @@ void MaemoDeployStep::installToSysroot()
|
|||||||
} else {
|
} else {
|
||||||
writeOutput(tr("Copying files to sysroot ..."));
|
writeOutput(tr("Copying files to sysroot ..."));
|
||||||
Q_ASSERT(!m_filesToCopy.isEmpty());
|
Q_ASSERT(!m_filesToCopy.isEmpty());
|
||||||
QDir sysRootDir(toolChain()->sysrootRoot());
|
QDir sysRootDir(toolChain()->sysroot());
|
||||||
foreach (const MaemoDeployable &d, m_filesToCopy) {
|
foreach (const MaemoDeployable &d, m_filesToCopy) {
|
||||||
const QLatin1Char sep('/');
|
const QLatin1Char sep('/');
|
||||||
const QString targetFilePath = toolChain()->sysrootRoot() + sep
|
const QString targetFilePath = toolChain()->sysroot() + sep
|
||||||
+ d.remoteDir + sep + QFileInfo(d.localFilePath).fileName();
|
+ d.remoteDir + sep + QFileInfo(d.localFilePath).fileName();
|
||||||
sysRootDir.mkpath(d.remoteDir.mid(1));
|
sysRootDir.mkpath(d.remoteDir.mid(1));
|
||||||
QFile::remove(targetFilePath);
|
QFile::remove(targetFilePath);
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ MaemoDeployStep *MaemoRunConfiguration::deployStep() const
|
|||||||
const QString MaemoRunConfiguration::sysRoot() const
|
const QString MaemoRunConfiguration::sysRoot() const
|
||||||
{
|
{
|
||||||
if (const MaemoToolChain *tc = toolchain())
|
if (const MaemoToolChain *tc = toolchain())
|
||||||
return tc->sysrootRoot();
|
return tc->sysroot();
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ void MaemoToolChain::addToEnvironment(Utils::Environment &env)
|
|||||||
.arg(MaemoGlobal::targetRoot(m_qtVersion))));
|
.arg(MaemoGlobal::targetRoot(m_qtVersion))));
|
||||||
|
|
||||||
// put this into environment to make pkg-config stuff work
|
// put this into environment to make pkg-config stuff work
|
||||||
env.prependOrSet(QLatin1String("SYSROOT_DIR"), sysrootRoot());
|
env.prependOrSet(QLatin1String("SYSROOT_DIR"), sysroot());
|
||||||
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/madbin")
|
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/madbin")
|
||||||
.arg(maddeRoot)));
|
.arg(maddeRoot)));
|
||||||
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/madlib")
|
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/madlib")
|
||||||
@@ -90,7 +90,7 @@ bool MaemoToolChain::equals(const ToolChain *other) const
|
|||||||
return other->type() == type() && toolChain->m_qtVersion == m_qtVersion;
|
return other->type() == type() && toolChain->m_qtVersion == m_qtVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MaemoToolChain::sysrootRoot() const
|
QString MaemoToolChain::sysroot() const
|
||||||
{
|
{
|
||||||
if (!m_sysrootInitialized)
|
if (!m_sysrootInitialized)
|
||||||
setSysroot();
|
setSysroot();
|
||||||
|
|||||||
@@ -49,8 +49,7 @@ public:
|
|||||||
void addToEnvironment(Utils::Environment &env);
|
void addToEnvironment(Utils::Environment &env);
|
||||||
ProjectExplorer::ToolChainType type() const;
|
ProjectExplorer::ToolChainType type() const;
|
||||||
QString makeCommand() const;
|
QString makeCommand() const;
|
||||||
|
QString sysroot() const;
|
||||||
QString sysrootRoot() const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool equals(const ToolChain *other) const;
|
bool equals(const ToolChain *other) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user