forked from qt-creator/qt-creator
Propagate cpuDir into QnxToolChain
Add sdpPath and cpuDir comparison to QNX tool chain comparison. Ensures that QnxConfiguration created tool chains don't get removed just because they have the same ABI as another QNX configuration created tool chain. This should really be visible in the interface but that can be done later since this isn't something that can currently happen with official 6.6.0/7.0.0 SDPs. Change-Id: Ibbb6a8aa645721028d1512460e51e59633b3cedc Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -276,6 +276,7 @@ QnxToolChain *QnxConfiguration::createToolChain(const Target &target)
|
||||
.arg(displayName())
|
||||
.arg(target.shortDescription()));
|
||||
toolChain->setSdpPath(sdpPath().toString());
|
||||
toolChain->setCpuDir(target.cpuDir());
|
||||
toolChain->resetToolChain(qccCompilerPath());
|
||||
ToolChainManager::registerToolChain(toolChain);
|
||||
return toolChain;
|
||||
|
||||
@@ -42,6 +42,7 @@ namespace Qnx {
|
||||
namespace Internal {
|
||||
|
||||
static const char CompilerSdpPath[] = "Qnx.QnxToolChain.NDKPath";
|
||||
static const char CpuDirKey[] = "Qnx.QnxToolChain.CpuDir";
|
||||
|
||||
static QList<Abi> detectTargetAbis(const FileName &sdpPath)
|
||||
{
|
||||
@@ -146,6 +147,7 @@ QVariantMap QnxToolChain::toMap() const
|
||||
{
|
||||
QVariantMap data = GccToolChain::toMap();
|
||||
data.insert(QLatin1String(CompilerSdpPath), m_sdpPath);
|
||||
data.insert(QLatin1String(CpuDirKey), m_cpuDir);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -155,6 +157,7 @@ bool QnxToolChain::fromMap(const QVariantMap &data)
|
||||
return false;
|
||||
|
||||
m_sdpPath = data.value(QLatin1String(CompilerSdpPath)).toString();
|
||||
m_cpuDir = data.value(QLatin1String(CpuDirKey)).toString();
|
||||
|
||||
// Make the ABIs QNX specific (if they aren't already).
|
||||
setSupportedAbis(QnxUtils::convertAbis(supportedAbis()));
|
||||
@@ -176,11 +179,34 @@ void QnxToolChain::setSdpPath(const QString &sdpPath)
|
||||
toolChainUpdated();
|
||||
}
|
||||
|
||||
QString QnxToolChain::cpuDir() const
|
||||
{
|
||||
return m_cpuDir;
|
||||
}
|
||||
|
||||
void QnxToolChain::setCpuDir(const QString &cpuDir)
|
||||
{
|
||||
if (m_cpuDir == cpuDir)
|
||||
return;
|
||||
m_cpuDir = cpuDir;
|
||||
toolChainUpdated();
|
||||
}
|
||||
|
||||
GccToolChain::DetectedAbisResult QnxToolChain::detectSupportedAbis() const
|
||||
{
|
||||
return detectTargetAbis(FileName::fromString(m_sdpPath));
|
||||
}
|
||||
|
||||
bool QnxToolChain::operator ==(const ToolChain &other) const
|
||||
{
|
||||
if (!GccToolChain::operator ==(other))
|
||||
return false;
|
||||
|
||||
auto qnxTc = static_cast<const QnxToolChain *>(&other);
|
||||
|
||||
return m_sdpPath == qnxTc->m_sdpPath && m_cpuDir == qnxTc->m_cpuDir;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// QnxToolChainFactory
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
@@ -49,12 +49,17 @@ public:
|
||||
|
||||
QString sdpPath() const;
|
||||
void setSdpPath(const QString &sdpPath);
|
||||
QString cpuDir() const;
|
||||
void setCpuDir(const QString &cpuDir);
|
||||
|
||||
bool operator ==(const ToolChain &) const override;
|
||||
|
||||
protected:
|
||||
virtual DetectedAbisResult detectSupportedAbis() const override;
|
||||
|
||||
private:
|
||||
QString m_sdpPath;
|
||||
QString m_cpuDir;
|
||||
};
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user