forked from qt-creator/qt-creator
Prevent QNX tool chain demotion
Change-Id: Ia355cf80131e36e806781665c4926769a1b144f8 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
#include <debugger/debuggerkitinformation.h>
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <utils/algorithm.h>
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QFileInfo>
|
||||
@@ -277,6 +278,16 @@ QnxQtVersion* QnxConfiguration::qnxQtVersion(QnxArchitecture arch) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
QList<ToolChain *> QnxConfiguration::autoDetect(const QList<ToolChain *> &alreadyKnown)
|
||||
{
|
||||
QList<ToolChain *> result;
|
||||
|
||||
result += findToolChain(alreadyKnown, ArmLeV7);
|
||||
result += findToolChain(alreadyKnown, X86);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
QVariant QnxConfiguration::createDebuggerItem(QnxArchitecture arch, const QString &displayName)
|
||||
{
|
||||
FileName command = (arch == X86) ? x86DebuggerPath() : armDebuggerPath();
|
||||
@@ -304,6 +315,18 @@ QnxToolChain *QnxConfiguration::createToolChain(QnxArchitecture arch, const QStr
|
||||
return toolChain;
|
||||
}
|
||||
|
||||
QList<ToolChain *> QnxConfiguration::findToolChain(const QList<ToolChain *> &alreadyKnown,
|
||||
QnxArchitecture arch)
|
||||
{
|
||||
Abi abi((arch == Qnx::ArmLeV7) ? Abi::ArmArchitecture : Abi::X86Architecture,
|
||||
Abi::LinuxOS, Abi::GenericLinuxFlavor, Abi::ElfFormat, 32);
|
||||
return Utils::filtered(alreadyKnown, [this, abi](ToolChain *tc) {
|
||||
return tc->typeId() == Constants::QNX_TOOLCHAIN_ID
|
||||
&& tc->targetAbi() == abi
|
||||
&& tc->compilerCommand() == m_qccCompiler;
|
||||
});
|
||||
}
|
||||
|
||||
Kit *QnxConfiguration::createKit(QnxArchitecture arch,
|
||||
QnxToolChain *toolChain,
|
||||
const QVariant &debuggerItemId,
|
||||
|
@@ -38,7 +38,11 @@
|
||||
|
||||
#include <QVariant>
|
||||
|
||||
namespace ProjectExplorer { class Kit; }
|
||||
namespace ProjectExplorer
|
||||
{
|
||||
class Kit;
|
||||
class ToolChain;
|
||||
}
|
||||
|
||||
namespace Qnx {
|
||||
namespace Internal {
|
||||
@@ -73,12 +77,18 @@ public:
|
||||
Utils::FileName sdpPath() const;
|
||||
QnxQtVersion* qnxQtVersion(QnxArchitecture arch) const;
|
||||
|
||||
QList<ProjectExplorer::ToolChain *> autoDetect(
|
||||
const QList<ProjectExplorer::ToolChain *> &alreadyKnown);
|
||||
|
||||
private:
|
||||
QVariant createDebuggerItem(Qnx::QnxArchitecture arch,
|
||||
const QString &displayName);
|
||||
QnxToolChain* createToolChain(Qnx::QnxArchitecture arch,
|
||||
const QString &displayName,
|
||||
const QString &ndkPath);
|
||||
QList<ProjectExplorer::ToolChain *> findToolChain(
|
||||
const QList<ProjectExplorer::ToolChain *> &alreadyKnown,
|
||||
Qnx::QnxArchitecture arch);
|
||||
|
||||
ProjectExplorer::Kit *createKit(QnxArchitecture arch,
|
||||
QnxToolChain *toolChain,
|
||||
|
@@ -24,6 +24,8 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "qnxtoolchain.h"
|
||||
#include "qnxconfiguration.h"
|
||||
#include "qnxconfigurationmanager.h"
|
||||
#include "qnxconstants.h"
|
||||
#include "qnxutils.h"
|
||||
|
||||
@@ -160,6 +162,17 @@ QnxToolChainFactory::QnxToolChainFactory()
|
||||
setDisplayName(tr("QCC"));
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::ToolChain *> QnxToolChainFactory::autoDetect(
|
||||
const QList<ProjectExplorer::ToolChain *> &alreadyKnown)
|
||||
{
|
||||
QList<ToolChain *> tcs;
|
||||
QList<QnxConfiguration *> configurations =
|
||||
QnxConfigurationManager::instance()->configurations();
|
||||
foreach (QnxConfiguration *configuration, configurations)
|
||||
tcs += configuration->autoDetect(alreadyKnown);
|
||||
return tcs;
|
||||
}
|
||||
|
||||
QSet<ToolChain::Language> QnxToolChainFactory::supportedLanguages() const
|
||||
{
|
||||
return { ProjectExplorer::ToolChain::Language::Cxx };
|
||||
|
@@ -69,6 +69,10 @@ class QnxToolChainFactory : public ProjectExplorer::ToolChainFactory
|
||||
|
||||
public:
|
||||
QnxToolChainFactory();
|
||||
|
||||
QList<ProjectExplorer::ToolChain *> autoDetect(
|
||||
const QList<ProjectExplorer::ToolChain *> &alreadyKnown) override;
|
||||
|
||||
QSet<ProjectExplorer::ToolChain::Language> supportedLanguages() const override;
|
||||
|
||||
bool canRestore(const QVariantMap &data) override;
|
||||
|
Reference in New Issue
Block a user