forked from qt-creator/qt-creator
ProjectExplorer: De-QObject-ify ToolChainFactory
As collateral damage, use a capital C in KeilToolchain*. Change-Id: If9d64de2108366546683144975d975d9d1727712 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -76,7 +76,7 @@ static ToolChain *findToolChain(Utils::FilePath &compilerPath, Core::Id lang, co
|
||||
AndroidToolChain::AndroidToolChain()
|
||||
: ClangToolChain(Constants::ANDROID_TOOLCHAIN_TYPEID)
|
||||
{
|
||||
setTypeDisplayName(AndroidToolChainFactory::tr("Android Clang"));
|
||||
setTypeDisplayName(AndroidToolChain::tr("Android Clang"));
|
||||
}
|
||||
|
||||
Utils::FilePath AndroidToolChain::ndkLocation() const
|
||||
@@ -155,7 +155,7 @@ GccToolChain::DetectedAbisResult AndroidToolChain::detectSupportedAbis() const
|
||||
|
||||
AndroidToolChainFactory::AndroidToolChainFactory()
|
||||
{
|
||||
setDisplayName(tr("Android Clang"));
|
||||
setDisplayName(AndroidToolChain::tr("Android Clang"));
|
||||
setSupportedToolChainType(Constants::ANDROID_TOOLCHAIN_TYPEID);
|
||||
setSupportedLanguages({ProjectExplorer::Constants::CXX_LANGUAGE_ID});
|
||||
setToolchainConstructor([] { return new AndroidToolChain; });
|
||||
|
@@ -36,6 +36,8 @@ using ToolChainList = QList<ProjectExplorer::ToolChain *>;
|
||||
|
||||
class AndroidToolChain : public ProjectExplorer::ClangToolChain
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(Android::Internal::AndroidToolChain)
|
||||
|
||||
public:
|
||||
~AndroidToolChain() override;
|
||||
|
||||
@@ -62,8 +64,6 @@ private:
|
||||
|
||||
class AndroidToolChainFactory : public ProjectExplorer::ToolChainFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AndroidToolChainFactory();
|
||||
|
||||
|
@@ -70,7 +70,7 @@ class BareMetalPluginPrivate
|
||||
{
|
||||
public:
|
||||
IarToolChainFactory iarToolChainFactory;
|
||||
KeilToolchainFactory keilToolChainFactory;
|
||||
KeilToolChainFactory keilToolChainFactory;
|
||||
SdccToolChainFactory sdccToolChainFactory;
|
||||
BareMetalDeviceFactory deviceFactory;
|
||||
BareMetalRunConfigurationFactory runConfigurationFactory;
|
||||
|
@@ -238,8 +238,7 @@ static QString buildDisplayName(Abi::Architecture arch, Core::Id language,
|
||||
{
|
||||
const auto archName = Abi::toString(arch);
|
||||
const auto langName = ToolChainManager::displayNameOfLanguageId(language);
|
||||
return IarToolChain::tr("IAREW %1 (%2, %3)")
|
||||
.arg(version, langName, archName);
|
||||
return IarToolChain::tr("IAREW %1 (%2, %3)").arg(version, langName, archName);
|
||||
}
|
||||
|
||||
// IarToolChain
|
||||
@@ -247,7 +246,7 @@ static QString buildDisplayName(Abi::Architecture arch, Core::Id language,
|
||||
IarToolChain::IarToolChain() :
|
||||
ToolChain(Constants::IAREW_TOOLCHAIN_TYPEID)
|
||||
{
|
||||
setTypeDisplayName(Internal::IarToolChainFactory::tr("IAREW"));
|
||||
setTypeDisplayName(Internal::IarToolChain::tr("IAREW"));
|
||||
}
|
||||
|
||||
void IarToolChain::setTargetAbi(const Abi &abi)
|
||||
@@ -416,7 +415,7 @@ FilePath IarToolChain::makeCommand(const Environment &env) const
|
||||
|
||||
IarToolChainFactory::IarToolChainFactory()
|
||||
{
|
||||
setDisplayName(tr("IAREW"));
|
||||
setDisplayName(IarToolChain::tr("IAREW"));
|
||||
setSupportedToolChainType(Constants::IAREW_TOOLCHAIN_TYPEID);
|
||||
setSupportedLanguages({ProjectExplorer::Constants::C_LANGUAGE_ID,
|
||||
ProjectExplorer::Constants::CXX_LANGUAGE_ID});
|
||||
|
@@ -96,8 +96,6 @@ private:
|
||||
|
||||
class IarToolChainFactory final : public ProjectExplorer::ToolChainFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
IarToolChainFactory();
|
||||
|
||||
|
@@ -230,19 +230,19 @@ static QString buildDisplayName(Abi::Architecture arch, Core::Id language,
|
||||
{
|
||||
const auto archName = Abi::toString(arch);
|
||||
const auto langName = ToolChainManager::displayNameOfLanguageId(language);
|
||||
return KeilToolchain::tr("KEIL %1 (%2, %3)")
|
||||
return KeilToolChain::tr("KEIL %1 (%2, %3)")
|
||||
.arg(version, langName, archName);
|
||||
}
|
||||
|
||||
// KeilToolchain
|
||||
|
||||
KeilToolchain::KeilToolchain() :
|
||||
KeilToolChain::KeilToolChain() :
|
||||
ToolChain(Constants::KEIL_TOOLCHAIN_TYPEID)
|
||||
{
|
||||
setTypeDisplayName(Internal::KeilToolchainFactory::tr("KEIL"));
|
||||
setTypeDisplayName(tr("KEIL"));
|
||||
}
|
||||
|
||||
void KeilToolchain::setTargetAbi(const Abi &abi)
|
||||
void KeilToolChain::setTargetAbi(const Abi &abi)
|
||||
{
|
||||
if (abi == m_targetAbi)
|
||||
return;
|
||||
@@ -250,17 +250,17 @@ void KeilToolchain::setTargetAbi(const Abi &abi)
|
||||
toolChainUpdated();
|
||||
}
|
||||
|
||||
Abi KeilToolchain::targetAbi() const
|
||||
Abi KeilToolChain::targetAbi() const
|
||||
{
|
||||
return m_targetAbi;
|
||||
}
|
||||
|
||||
bool KeilToolchain::isValid() const
|
||||
bool KeilToolChain::isValid() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
ToolChain::MacroInspectionRunner KeilToolchain::createMacroInspectionRunner() const
|
||||
ToolChain::MacroInspectionRunner KeilToolChain::createMacroInspectionRunner() const
|
||||
{
|
||||
Environment env = Environment::systemEnvironment();
|
||||
addToEnvironment(env);
|
||||
@@ -282,23 +282,23 @@ ToolChain::MacroInspectionRunner KeilToolchain::createMacroInspectionRunner() co
|
||||
};
|
||||
}
|
||||
|
||||
Macros KeilToolchain::predefinedMacros(const QStringList &cxxflags) const
|
||||
Macros KeilToolChain::predefinedMacros(const QStringList &cxxflags) const
|
||||
{
|
||||
return createMacroInspectionRunner()(cxxflags).macros;
|
||||
}
|
||||
|
||||
Utils::LanguageExtensions KeilToolchain::languageExtensions(const QStringList &) const
|
||||
Utils::LanguageExtensions KeilToolChain::languageExtensions(const QStringList &) const
|
||||
{
|
||||
return LanguageExtension::None;
|
||||
}
|
||||
|
||||
WarningFlags KeilToolchain::warningFlags(const QStringList &cxxflags) const
|
||||
WarningFlags KeilToolChain::warningFlags(const QStringList &cxxflags) const
|
||||
{
|
||||
Q_UNUSED(cxxflags)
|
||||
return WarningFlags::Default;
|
||||
}
|
||||
|
||||
ToolChain::BuiltInHeaderPathsRunner KeilToolchain::createBuiltInHeaderPathsRunner(
|
||||
ToolChain::BuiltInHeaderPathsRunner KeilToolChain::createBuiltInHeaderPathsRunner(
|
||||
const Environment &) const
|
||||
{
|
||||
const Utils::FilePath compilerCommand = m_compilerCommand;
|
||||
@@ -317,14 +317,14 @@ ToolChain::BuiltInHeaderPathsRunner KeilToolchain::createBuiltInHeaderPathsRunne
|
||||
};
|
||||
}
|
||||
|
||||
HeaderPaths KeilToolchain::builtInHeaderPaths(const QStringList &cxxFlags,
|
||||
HeaderPaths KeilToolChain::builtInHeaderPaths(const QStringList &cxxFlags,
|
||||
const FilePath &fileName,
|
||||
const Environment &env) const
|
||||
{
|
||||
return createBuiltInHeaderPathsRunner(env)(cxxFlags, fileName.toString(), "");
|
||||
}
|
||||
|
||||
void KeilToolchain::addToEnvironment(Environment &env) const
|
||||
void KeilToolChain::addToEnvironment(Environment &env) const
|
||||
{
|
||||
if (!m_compilerCommand.isEmpty()) {
|
||||
const FilePath path = m_compilerCommand.parentDir();
|
||||
@@ -332,12 +332,12 @@ void KeilToolchain::addToEnvironment(Environment &env) const
|
||||
}
|
||||
}
|
||||
|
||||
IOutputParser *KeilToolchain::outputParser() const
|
||||
IOutputParser *KeilToolChain::outputParser() const
|
||||
{
|
||||
return new KeilParser;
|
||||
}
|
||||
|
||||
QVariantMap KeilToolchain::toMap() const
|
||||
QVariantMap KeilToolChain::toMap() const
|
||||
{
|
||||
QVariantMap data = ToolChain::toMap();
|
||||
data.insert(compilerCommandKeyC, m_compilerCommand.toString());
|
||||
@@ -345,7 +345,7 @@ QVariantMap KeilToolchain::toMap() const
|
||||
return data;
|
||||
}
|
||||
|
||||
bool KeilToolchain::fromMap(const QVariantMap &data)
|
||||
bool KeilToolChain::fromMap(const QVariantMap &data)
|
||||
{
|
||||
if (!ToolChain::fromMap(data))
|
||||
return false;
|
||||
@@ -354,23 +354,23 @@ bool KeilToolchain::fromMap(const QVariantMap &data)
|
||||
return true;
|
||||
}
|
||||
|
||||
std::unique_ptr<ToolChainConfigWidget> KeilToolchain::createConfigurationWidget()
|
||||
std::unique_ptr<ToolChainConfigWidget> KeilToolChain::createConfigurationWidget()
|
||||
{
|
||||
return std::make_unique<KeilToolchainConfigWidget>(this);
|
||||
return std::make_unique<KeilToolChainConfigWidget>(this);
|
||||
}
|
||||
|
||||
bool KeilToolchain::operator ==(const ToolChain &other) const
|
||||
bool KeilToolChain::operator ==(const ToolChain &other) const
|
||||
{
|
||||
if (!ToolChain::operator ==(other))
|
||||
return false;
|
||||
|
||||
const auto customTc = static_cast<const KeilToolchain *>(&other);
|
||||
const auto customTc = static_cast<const KeilToolChain *>(&other);
|
||||
return m_compilerCommand == customTc->m_compilerCommand
|
||||
&& m_targetAbi == customTc->m_targetAbi
|
||||
;
|
||||
}
|
||||
|
||||
void KeilToolchain::setCompilerCommand(const FilePath &file)
|
||||
void KeilToolChain::setCompilerCommand(const FilePath &file)
|
||||
{
|
||||
if (file == m_compilerCommand)
|
||||
return;
|
||||
@@ -378,12 +378,12 @@ void KeilToolchain::setCompilerCommand(const FilePath &file)
|
||||
toolChainUpdated();
|
||||
}
|
||||
|
||||
FilePath KeilToolchain::compilerCommand() const
|
||||
FilePath KeilToolChain::compilerCommand() const
|
||||
{
|
||||
return m_compilerCommand;
|
||||
}
|
||||
|
||||
FilePath KeilToolchain::makeCommand(const Environment &env) const
|
||||
FilePath KeilToolChain::makeCommand(const Environment &env) const
|
||||
{
|
||||
Q_UNUSED(env)
|
||||
return {};
|
||||
@@ -391,13 +391,13 @@ FilePath KeilToolchain::makeCommand(const Environment &env) const
|
||||
|
||||
// KeilToolchainFactory
|
||||
|
||||
KeilToolchainFactory::KeilToolchainFactory()
|
||||
KeilToolChainFactory::KeilToolChainFactory()
|
||||
{
|
||||
setDisplayName(tr("KEIL"));
|
||||
setDisplayName(KeilToolChain::tr("KEIL"));
|
||||
setSupportedToolChainType(Constants::KEIL_TOOLCHAIN_TYPEID);
|
||||
setSupportedLanguages({ProjectExplorer::Constants::C_LANGUAGE_ID,
|
||||
ProjectExplorer::Constants::CXX_LANGUAGE_ID});
|
||||
setToolchainConstructor([] { return new KeilToolchain; });
|
||||
setToolchainConstructor([] { return new KeilToolChain; });
|
||||
setUserCreatable(true);
|
||||
}
|
||||
|
||||
@@ -445,7 +445,7 @@ static QString extractVersion(const QString &toolsFile, const QString §ion)
|
||||
return {};
|
||||
}
|
||||
|
||||
QList<ToolChain *> KeilToolchainFactory::autoDetect(const QList<ToolChain *> &alreadyKnown)
|
||||
QList<ToolChain *> KeilToolChainFactory::autoDetect(const QList<ToolChain *> &alreadyKnown)
|
||||
{
|
||||
#ifdef Q_OS_WIN64
|
||||
static const char kRegistryNode[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\" \
|
||||
@@ -492,7 +492,7 @@ QList<ToolChain *> KeilToolchainFactory::autoDetect(const QList<ToolChain *> &al
|
||||
return autoDetectToolchains(candidates, alreadyKnown);
|
||||
}
|
||||
|
||||
QList<ToolChain *> KeilToolchainFactory::autoDetectToolchains(
|
||||
QList<ToolChain *> KeilToolChainFactory::autoDetectToolchains(
|
||||
const Candidates &candidates, const QList<ToolChain *> &alreadyKnown) const
|
||||
{
|
||||
QList<ToolChain *> result;
|
||||
@@ -519,7 +519,7 @@ QList<ToolChain *> KeilToolchainFactory::autoDetectToolchains(
|
||||
return result;
|
||||
}
|
||||
|
||||
QList<ToolChain *> KeilToolchainFactory::autoDetectToolchain(
|
||||
QList<ToolChain *> KeilToolChainFactory::autoDetectToolchain(
|
||||
const Candidate &candidate, Core::Id language) const
|
||||
{
|
||||
const auto env = Environment::systemEnvironment();
|
||||
@@ -535,7 +535,7 @@ QList<ToolChain *> KeilToolchainFactory::autoDetectToolchain(
|
||||
return {};
|
||||
}
|
||||
|
||||
const auto tc = new KeilToolchain;
|
||||
const auto tc = new KeilToolChain;
|
||||
tc->setDetection(ToolChain::AutoDetection);
|
||||
tc->setLanguage(language);
|
||||
tc->setCompilerCommand(candidate.compilerPath);
|
||||
@@ -549,7 +549,7 @@ QList<ToolChain *> KeilToolchainFactory::autoDetectToolchain(
|
||||
|
||||
// KeilToolchainConfigWidget
|
||||
|
||||
KeilToolchainConfigWidget::KeilToolchainConfigWidget(KeilToolchain *tc) :
|
||||
KeilToolChainConfigWidget::KeilToolChainConfigWidget(KeilToolChain *tc) :
|
||||
ToolChainConfigWidget(tc),
|
||||
m_compilerCommand(new PathChooser),
|
||||
m_abiWidget(new AbiWidget)
|
||||
@@ -562,20 +562,20 @@ KeilToolchainConfigWidget::KeilToolchainConfigWidget(KeilToolchain *tc) :
|
||||
m_abiWidget->setEnabled(false);
|
||||
|
||||
addErrorLabel();
|
||||
setFromToolchain();
|
||||
setFromToolChain();
|
||||
|
||||
connect(m_compilerCommand, &PathChooser::rawPathChanged,
|
||||
this, &KeilToolchainConfigWidget::handleCompilerCommandChange);
|
||||
this, &KeilToolChainConfigWidget::handleCompilerCommandChange);
|
||||
connect(m_abiWidget, &AbiWidget::abiChanged,
|
||||
this, &ToolChainConfigWidget::dirty);
|
||||
}
|
||||
|
||||
void KeilToolchainConfigWidget::applyImpl()
|
||||
void KeilToolChainConfigWidget::applyImpl()
|
||||
{
|
||||
if (toolChain()->isAutoDetected())
|
||||
return;
|
||||
|
||||
const auto tc = static_cast<KeilToolchain *>(toolChain());
|
||||
const auto tc = static_cast<KeilToolChain *>(toolChain());
|
||||
const QString displayName = tc->displayName();
|
||||
tc->setCompilerCommand(m_compilerCommand->fileName());
|
||||
tc->setTargetAbi(m_abiWidget->currentAbi());
|
||||
@@ -587,34 +587,34 @@ void KeilToolchainConfigWidget::applyImpl()
|
||||
const auto languageVersion = ToolChain::languageVersion(tc->language(), m_macros);
|
||||
tc->predefinedMacrosCache()->insert({}, {m_macros, languageVersion});
|
||||
|
||||
setFromToolchain();
|
||||
setFromToolChain();
|
||||
}
|
||||
|
||||
bool KeilToolchainConfigWidget::isDirtyImpl() const
|
||||
bool KeilToolChainConfigWidget::isDirtyImpl() const
|
||||
{
|
||||
const auto tc = static_cast<KeilToolchain *>(toolChain());
|
||||
const auto tc = static_cast<KeilToolChain *>(toolChain());
|
||||
return m_compilerCommand->fileName() != tc->compilerCommand()
|
||||
|| m_abiWidget->currentAbi() != tc->targetAbi()
|
||||
;
|
||||
}
|
||||
|
||||
void KeilToolchainConfigWidget::makeReadOnlyImpl()
|
||||
void KeilToolChainConfigWidget::makeReadOnlyImpl()
|
||||
{
|
||||
m_compilerCommand->setReadOnly(true);
|
||||
m_abiWidget->setEnabled(false);
|
||||
}
|
||||
|
||||
void KeilToolchainConfigWidget::setFromToolchain()
|
||||
void KeilToolChainConfigWidget::setFromToolChain()
|
||||
{
|
||||
const QSignalBlocker blocker(this);
|
||||
const auto tc = static_cast<KeilToolchain *>(toolChain());
|
||||
const auto tc = static_cast<KeilToolChain *>(toolChain());
|
||||
m_compilerCommand->setFileName(tc->compilerCommand());
|
||||
m_abiWidget->setAbis({}, tc->targetAbi());
|
||||
const bool haveCompiler = compilerExists(m_compilerCommand->fileName());
|
||||
m_abiWidget->setEnabled(haveCompiler && !tc->isAutoDetected());
|
||||
}
|
||||
|
||||
void KeilToolchainConfigWidget::handleCompilerCommandChange()
|
||||
void KeilToolChainConfigWidget::handleCompilerCommandChange()
|
||||
{
|
||||
const FilePath compilerPath = m_compilerCommand->fileName();
|
||||
const bool haveCompiler = compilerExists(compilerPath);
|
||||
|
@@ -45,11 +45,11 @@ namespace ProjectExplorer { class AbiWidget; }
|
||||
namespace BareMetal {
|
||||
namespace Internal {
|
||||
|
||||
// KeilToolchain
|
||||
// KeilToolChain
|
||||
|
||||
class KeilToolchain final : public ProjectExplorer::ToolChain
|
||||
class KeilToolChain final : public ProjectExplorer::ToolChain
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(KeilToolchain)
|
||||
Q_DECLARE_TR_FUNCTIONS(KeilToolChain)
|
||||
|
||||
public:
|
||||
void setTargetAbi(const ProjectExplorer::Abi &abi);
|
||||
@@ -84,23 +84,21 @@ public:
|
||||
Utils::FilePath makeCommand(const Utils::Environment &env) const final;
|
||||
|
||||
private:
|
||||
KeilToolchain();
|
||||
KeilToolChain();
|
||||
|
||||
ProjectExplorer::Abi m_targetAbi;
|
||||
Utils::FilePath m_compilerCommand;
|
||||
|
||||
friend class KeilToolchainFactory;
|
||||
friend class KeilToolchainConfigWidget;
|
||||
friend class KeilToolChainFactory;
|
||||
friend class KeilToolChainConfigWidget;
|
||||
};
|
||||
|
||||
// KeilToolchainFactory
|
||||
|
||||
class KeilToolchainFactory final : public ProjectExplorer::ToolChainFactory
|
||||
class KeilToolChainFactory final : public ProjectExplorer::ToolChainFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
KeilToolchainFactory();
|
||||
KeilToolChainFactory();
|
||||
|
||||
QList<ProjectExplorer::ToolChain *> autoDetect(
|
||||
const QList<ProjectExplorer::ToolChain *> &alreadyKnown) final;
|
||||
@@ -114,20 +112,20 @@ private:
|
||||
|
||||
// KeilToolchainConfigWidget
|
||||
|
||||
class KeilToolchainConfigWidget final : public ProjectExplorer::ToolChainConfigWidget
|
||||
class KeilToolChainConfigWidget final : public ProjectExplorer::ToolChainConfigWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit KeilToolchainConfigWidget(KeilToolchain *tc);
|
||||
explicit KeilToolChainConfigWidget(KeilToolChain *tc);
|
||||
|
||||
private:
|
||||
void applyImpl() final;
|
||||
void discardImpl() final { setFromToolchain(); }
|
||||
void discardImpl() final { setFromToolChain(); }
|
||||
bool isDirtyImpl() const final;
|
||||
void makeReadOnlyImpl() final;
|
||||
|
||||
void setFromToolchain();
|
||||
void setFromToolChain();
|
||||
void handleCompilerCommandChange();
|
||||
|
||||
Utils::PathChooser *m_compilerCommand = nullptr;
|
||||
|
@@ -217,7 +217,7 @@ static Utils::FilePath compilerPathFromEnvironment(const QString &compilerName)
|
||||
SdccToolChain::SdccToolChain() :
|
||||
ToolChain(Constants::SDCC_TOOLCHAIN_TYPEID)
|
||||
{
|
||||
setTypeDisplayName(Internal::SdccToolChainFactory::tr("SDCC"));
|
||||
setTypeDisplayName(Internal::SdccToolChain::tr("SDCC"));
|
||||
}
|
||||
|
||||
void SdccToolChain::setTargetAbi(const Abi &abi)
|
||||
@@ -368,7 +368,7 @@ FilePath SdccToolChain::makeCommand(const Environment &env) const
|
||||
|
||||
SdccToolChainFactory::SdccToolChainFactory()
|
||||
{
|
||||
setDisplayName(tr("SDCC"));
|
||||
setDisplayName(SdccToolChain::tr("SDCC"));
|
||||
setSupportedToolChainType(Constants::SDCC_TOOLCHAIN_TYPEID);
|
||||
setSupportedLanguages({ProjectExplorer::Constants::C_LANGUAGE_ID});
|
||||
setToolchainConstructor([] { return new SdccToolChain; });
|
||||
|
@@ -97,8 +97,6 @@ private:
|
||||
|
||||
class SdccToolChainFactory final : public ProjectExplorer::ToolChainFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SdccToolChainFactory();
|
||||
|
||||
|
@@ -95,8 +95,6 @@ using DevelopmentTeams = QList<DevelopmentTeamPtr>;
|
||||
|
||||
class IosToolChainFactory : public ProjectExplorer::ToolChainFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
IosToolChainFactory();
|
||||
|
||||
|
@@ -49,7 +49,7 @@ NimToolChain::NimToolChain(Core::Id typeId)
|
||||
, m_version(std::make_tuple(-1,-1,-1))
|
||||
{
|
||||
setLanguage(Constants::C_NIMLANGUAGE_ID);
|
||||
setTypeDisplayName(NimToolChainFactory::tr("Nim"));
|
||||
setTypeDisplayName(tr("Nim"));
|
||||
}
|
||||
|
||||
Abi NimToolChain::targetAbi() const
|
||||
|
@@ -32,6 +32,8 @@ namespace Nim {
|
||||
|
||||
class NimToolChain : public ProjectExplorer::ToolChain
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(Nim::NimToolChain)
|
||||
|
||||
public:
|
||||
NimToolChain();
|
||||
explicit NimToolChain(Core::Id typeId);
|
||||
|
@@ -42,7 +42,7 @@ namespace Nim {
|
||||
|
||||
NimToolChainFactory::NimToolChainFactory()
|
||||
{
|
||||
setDisplayName(tr("Nim"));
|
||||
setDisplayName(NimToolChain::tr("Nim"));
|
||||
setSupportedToolChainType(Constants::C_NIMTOOLCHAIN_TYPEID);
|
||||
setSupportedLanguages({Constants::C_NIMLANGUAGE_ID});
|
||||
setToolchainConstructor([] { return new NimToolChain; });
|
||||
|
@@ -36,8 +36,6 @@ class NimToolChain;
|
||||
|
||||
class NimToolChainFactory : public ProjectExplorer::ToolChainFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
NimToolChainFactory();
|
||||
|
||||
|
@@ -85,7 +85,7 @@ CustomToolChain::CustomToolChain() :
|
||||
ToolChain(Constants::CUSTOM_TOOLCHAIN_TYPEID),
|
||||
m_outputParserId(GccParser::id())
|
||||
{
|
||||
setTypeDisplayName(Internal::CustomToolChainFactory::tr("Custom"));
|
||||
setTypeDisplayName(tr("Custom"));
|
||||
}
|
||||
|
||||
Abi CustomToolChain::targetAbi() const
|
||||
@@ -405,7 +405,7 @@ namespace Internal {
|
||||
|
||||
CustomToolChainFactory::CustomToolChainFactory()
|
||||
{
|
||||
setDisplayName(tr("Custom"));
|
||||
setDisplayName(CustomToolChain::tr("Custom"));
|
||||
setSupportedToolChainType(Constants::CUSTOM_TOOLCHAIN_TYPEID);
|
||||
setSupportsAllLanguages(true);
|
||||
setToolchainConstructor([] { return new CustomToolChain; });
|
||||
|
@@ -135,8 +135,6 @@ namespace Internal {
|
||||
|
||||
class CustomToolChainFactory : public ToolChainFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CustomToolChainFactory();
|
||||
};
|
||||
|
@@ -265,7 +265,7 @@ static Utils::FilePath gccInstallDir(const FilePath &path, const QStringList &en
|
||||
GccToolChain::GccToolChain(Core::Id typeId) :
|
||||
ToolChain(typeId)
|
||||
{
|
||||
setTypeDisplayName(GccToolChainFactory::tr("GCC"));
|
||||
setTypeDisplayName(tr("GCC"));
|
||||
}
|
||||
|
||||
void GccToolChain::setCompilerCommand(const FilePath &path)
|
||||
@@ -1045,7 +1045,7 @@ static Utils::FilePaths renesasRl78SearchPathsFromRegistry()
|
||||
|
||||
GccToolChainFactory::GccToolChainFactory()
|
||||
{
|
||||
setDisplayName(tr("GCC"));
|
||||
setDisplayName(GccToolChain::tr("GCC"));
|
||||
setSupportedToolChainType(Constants::GCC_TOOLCHAIN_TYPEID);
|
||||
setSupportedLanguages({Constants::C_LANGUAGE_ID, Constants::CXX_LANGUAGE_ID});
|
||||
setToolchainConstructor([] { return new GccToolChain(Constants::GCC_TOOLCHAIN_TYPEID); });
|
||||
@@ -1472,7 +1472,7 @@ ClangToolChain::ClangToolChain() :
|
||||
ClangToolChain::ClangToolChain(Core::Id typeId) :
|
||||
GccToolChain(typeId)
|
||||
{
|
||||
setTypeDisplayName(ClangToolChainFactory::tr("Clang"));
|
||||
setTypeDisplayName(tr("Clang"));
|
||||
syncAutodetectedWithParentToolchains();
|
||||
}
|
||||
|
||||
@@ -1639,7 +1639,7 @@ IOutputParser *ClangToolChain::outputParser() const
|
||||
|
||||
ClangToolChainFactory::ClangToolChainFactory()
|
||||
{
|
||||
setDisplayName(tr("Clang"));
|
||||
setDisplayName(ClangToolChain::tr("Clang"));
|
||||
setSupportedToolChainType(Constants::CLANG_TOOLCHAIN_TYPEID);
|
||||
setSupportedLanguages({Constants::CXX_LANGUAGE_ID, Constants::C_LANGUAGE_ID});
|
||||
setToolchainConstructor([] { return new ClangToolChain; });
|
||||
@@ -1798,7 +1798,7 @@ void ClangToolChainConfigWidget::makeReadOnlyImpl()
|
||||
MingwToolChain::MingwToolChain() :
|
||||
GccToolChain(Constants::MINGW_TOOLCHAIN_TYPEID)
|
||||
{
|
||||
setTypeDisplayName(MingwToolChainFactory::tr("MinGW"));
|
||||
setTypeDisplayName(MingwToolChain::tr("MinGW"));
|
||||
}
|
||||
|
||||
QStringList MingwToolChain::suggestedMkspecList() const
|
||||
@@ -1833,7 +1833,7 @@ FilePath MingwToolChain::makeCommand(const Environment &environment) const
|
||||
|
||||
MingwToolChainFactory::MingwToolChainFactory()
|
||||
{
|
||||
setDisplayName(tr("MinGW"));
|
||||
setDisplayName(MingwToolChain::tr("MinGW"));
|
||||
setSupportedToolChainType(Constants::MINGW_TOOLCHAIN_TYPEID);
|
||||
setSupportedLanguages({Constants::CXX_LANGUAGE_ID, Constants::C_LANGUAGE_ID});
|
||||
setToolchainConstructor([] { return new MingwToolChain; });
|
||||
@@ -1873,7 +1873,7 @@ QList<ToolChain *> MingwToolChainFactory::detectForImport(const ToolChainDescrip
|
||||
LinuxIccToolChain::LinuxIccToolChain() :
|
||||
GccToolChain(Constants::LINUXICC_TOOLCHAIN_TYPEID)
|
||||
{
|
||||
setTypeDisplayName(LinuxIccToolChainFactory::tr("ICC"));
|
||||
setTypeDisplayName(LinuxIccToolChain::tr("ICC"));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1914,7 +1914,7 @@ QStringList LinuxIccToolChain::suggestedMkspecList() const
|
||||
|
||||
LinuxIccToolChainFactory::LinuxIccToolChainFactory()
|
||||
{
|
||||
setDisplayName(tr("ICC"));
|
||||
setDisplayName(LinuxIccToolChain::tr("ICC"));
|
||||
setSupportedToolChainType(Constants::LINUXICC_TOOLCHAIN_TYPEID);
|
||||
setSupportedLanguages({Constants::CXX_LANGUAGE_ID, Constants::C_LANGUAGE_ID});
|
||||
setToolchainConstructor([] { return new LinuxIccToolChain; });
|
||||
|
@@ -66,6 +66,8 @@ inline const QStringList gccPredefinedMacrosOptions(Core::Id languageId)
|
||||
|
||||
class PROJECTEXPLORER_EXPORT GccToolChain : public ToolChain
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(ProjectExplorer::GccToolChain)
|
||||
|
||||
public:
|
||||
GccToolChain(Core::Id typeId);
|
||||
|
||||
@@ -212,6 +214,8 @@ private:
|
||||
|
||||
class PROJECTEXPLORER_EXPORT ClangToolChain : public GccToolChain
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(ProjectExplorer::ClangToolChain)
|
||||
|
||||
public:
|
||||
ClangToolChain();
|
||||
explicit ClangToolChain(Core::Id typeId);
|
||||
@@ -258,6 +262,8 @@ private:
|
||||
|
||||
class PROJECTEXPLORER_EXPORT MingwToolChain : public GccToolChain
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(ProjectExplorer::MingwToolChain)
|
||||
|
||||
public:
|
||||
Utils::FilePath makeCommand(const Utils::Environment &environment) const override;
|
||||
|
||||
@@ -276,6 +282,8 @@ private:
|
||||
|
||||
class PROJECTEXPLORER_EXPORT LinuxIccToolChain : public GccToolChain
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(ProjectExplorer::LinuxIccToolChain)
|
||||
|
||||
public:
|
||||
Utils::LanguageExtensions languageExtensions(const QStringList &cxxflags) const override;
|
||||
IOutputParser *outputParser() const override;
|
||||
|
@@ -49,8 +49,6 @@ namespace Internal {
|
||||
|
||||
class GccToolChainFactory : public ToolChainFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GccToolChainFactory();
|
||||
|
||||
@@ -132,8 +130,6 @@ private:
|
||||
|
||||
class ClangToolChainFactory : public GccToolChainFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ClangToolChainFactory();
|
||||
|
||||
@@ -147,8 +143,6 @@ public:
|
||||
|
||||
class MingwToolChainFactory : public GccToolChainFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MingwToolChainFactory();
|
||||
|
||||
@@ -162,8 +156,6 @@ public:
|
||||
|
||||
class LinuxIccToolChainFactory : public GccToolChainFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
LinuxIccToolChainFactory();
|
||||
|
||||
|
@@ -862,7 +862,7 @@ MsvcToolChain::MsvcToolChain(Core::Id typeId)
|
||||
: ToolChain(typeId)
|
||||
{
|
||||
setDisplayName("Microsoft Visual C++ Compiler");
|
||||
setTypeDisplayName(MsvcToolChainFactory::tr("MSVC"));
|
||||
setTypeDisplayName(tr("MSVC"));
|
||||
}
|
||||
|
||||
void MsvcToolChain::inferWarningsForLevel(int warningLevel, WarningFlags &flags)
|
||||
@@ -1784,7 +1784,7 @@ ClangClToolChain::BuiltInHeaderPathsRunner ClangClToolChain::createBuiltInHeader
|
||||
|
||||
MsvcToolChainFactory::MsvcToolChainFactory()
|
||||
{
|
||||
setDisplayName(tr("MSVC"));
|
||||
setDisplayName(MsvcToolChain::tr("MSVC"));
|
||||
setSupportedToolChainType(Constants::MSVC_TOOLCHAIN_TYPEID);
|
||||
setSupportedLanguages({Constants::C_LANGUAGE_ID, Constants::CXX_LANGUAGE_ID});
|
||||
setToolchainConstructor([] { return new MsvcToolChain(Constants::MSVC_TOOLCHAIN_TYPEID); });
|
||||
@@ -1966,7 +1966,7 @@ QList<ToolChain *> MsvcToolChainFactory::autoDetect(const QList<ToolChain *> &al
|
||||
|
||||
ClangClToolChainFactory::ClangClToolChainFactory()
|
||||
{
|
||||
setDisplayName(tr("clang-cl"));
|
||||
setDisplayName(ClangClToolChain::tr("clang-cl"));
|
||||
setSupportedLanguages({Constants::C_LANGUAGE_ID, Constants::CXX_LANGUAGE_ID});
|
||||
setSupportedToolChainType(Constants::CLANG_CL_TOOLCHAIN_TYPEID);
|
||||
setToolchainConstructor([] { return new ClangClToolChain; });
|
||||
|
@@ -53,6 +53,8 @@ namespace Internal {
|
||||
|
||||
class MsvcToolChain : public ToolChain
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(ProjectExplorer::Internal::MsvcToolChain)
|
||||
|
||||
public:
|
||||
enum Type { WindowsSDK, VS };
|
||||
enum Platform { x86, amd64, x86_amd64, ia64, x86_ia64, arm, x86_arm, amd64_arm, amd64_x86 };
|
||||
@@ -166,6 +168,8 @@ protected:
|
||||
|
||||
class PROJECTEXPLORER_EXPORT ClangClToolChain : public MsvcToolChain
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(ProjectExplorer::Internal::ClangClToolChain)
|
||||
|
||||
public:
|
||||
ClangClToolChain();
|
||||
|
||||
@@ -202,8 +206,6 @@ private:
|
||||
|
||||
class MsvcToolChainFactory : public ToolChainFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MsvcToolChainFactory();
|
||||
|
||||
@@ -218,8 +220,6 @@ public:
|
||||
|
||||
class ClangClToolChainFactory : public ToolChainFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ClangClToolChainFactory();
|
||||
|
||||
|
@@ -193,13 +193,14 @@ private:
|
||||
friend class ToolChainFactory;
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT ToolChainFactory : public QObject
|
||||
class PROJECTEXPLORER_EXPORT ToolChainFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
ToolChainFactory(const ToolChainFactory &) = delete;
|
||||
ToolChainFactory &operator=(const ToolChainFactory &) = delete;
|
||||
|
||||
public:
|
||||
ToolChainFactory();
|
||||
~ToolChainFactory() override;
|
||||
virtual ~ToolChainFactory();
|
||||
|
||||
static const QList<ToolChainFactory *> allToolChainFactories();
|
||||
|
||||
|
@@ -106,7 +106,7 @@ QnxToolChain::QnxToolChain()
|
||||
: GccToolChain(Constants::QNX_TOOLCHAIN_ID)
|
||||
{
|
||||
setOptionsReinterpreter(&reinterpretOptions);
|
||||
setTypeDisplayName(QnxToolChainFactory::tr("QCC"));
|
||||
setTypeDisplayName(tr("QCC"));
|
||||
}
|
||||
|
||||
std::unique_ptr<ToolChainConfigWidget> QnxToolChain::createConfigurationWidget()
|
||||
@@ -204,7 +204,7 @@ bool QnxToolChain::operator ==(const ToolChain &other) const
|
||||
|
||||
QnxToolChainFactory::QnxToolChainFactory()
|
||||
{
|
||||
setDisplayName(tr("QCC"));
|
||||
setDisplayName(QnxToolChain::tr("QCC"));
|
||||
setSupportedToolChainType(Constants::QNX_TOOLCHAIN_ID);
|
||||
setSupportedLanguages({ProjectExplorer::Constants::C_LANGUAGE_ID,
|
||||
ProjectExplorer::Constants::CXX_LANGUAGE_ID});
|
||||
|
@@ -33,6 +33,8 @@ namespace Internal {
|
||||
|
||||
class QnxToolChain : public ProjectExplorer::GccToolChain
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(Qnx::Internal::QnxToolChain)
|
||||
|
||||
public:
|
||||
QnxToolChain();
|
||||
|
||||
@@ -65,8 +67,6 @@ private:
|
||||
|
||||
class QnxToolChainFactory : public ProjectExplorer::ToolChainFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QnxToolChainFactory();
|
||||
|
||||
|
@@ -142,14 +142,14 @@ WebAssemblyToolChain::WebAssemblyToolChain() :
|
||||
setCompilerCommand(Utils::FilePath::fromString(command));
|
||||
setSupportedAbis({toolChainAbi()});
|
||||
setTargetAbi(toolChainAbi());
|
||||
const QString typeAndDisplayName = WebAssemblyToolChainFactory::tr("Emscripten Compiler");
|
||||
const QString typeAndDisplayName = tr("Emscripten Compiler");
|
||||
setDisplayName(typeAndDisplayName);
|
||||
setTypeDisplayName(typeAndDisplayName);
|
||||
}
|
||||
|
||||
WebAssemblyToolChainFactory::WebAssemblyToolChainFactory()
|
||||
{
|
||||
setDisplayName(tr("WebAssembly"));
|
||||
setDisplayName(WebAssemblyToolChain::tr("WebAssembly"));
|
||||
setSupportedToolChainType(Constants::WEBASSEMBLY_TOOLCHAIN_TYPEID);
|
||||
setSupportedLanguages({ProjectExplorer::Constants::C_LANGUAGE_ID,
|
||||
ProjectExplorer::Constants::CXX_LANGUAGE_ID});
|
||||
|
@@ -32,6 +32,8 @@ namespace Internal {
|
||||
|
||||
class WebAssemblyToolChain final : public ProjectExplorer::ClangToolChain
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(WebAssembly::Internal::WebAssemblyToolChain)
|
||||
|
||||
public:
|
||||
void addToEnvironment(Utils::Environment &env) const override;
|
||||
|
||||
@@ -43,8 +45,6 @@ private:
|
||||
|
||||
class WebAssemblyToolChainFactory : public ProjectExplorer::ToolChainFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
WebAssemblyToolChainFactory();
|
||||
|
||||
|
Reference in New Issue
Block a user