diff --git a/src/plugins/baremetal/iarewtoolchain.cpp b/src/plugins/baremetal/iarewtoolchain.cpp index c6653fefbb4..5e3f81f85b5 100644 --- a/src/plugins/baremetal/iarewtoolchain.cpp +++ b/src/plugins/baremetal/iarewtoolchain.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -262,15 +263,70 @@ static QString buildDisplayName(Abi::Architecture arch, Utils::Id language, return Tr::tr("IAREW %1 (%2, %3)").arg(version, langName, archName); } +// IarToolChainConfigWidget + +class IarToolChain; + +class IarToolChainConfigWidget final : public ToolChainConfigWidget +{ +public: + explicit IarToolChainConfigWidget(IarToolChain *tc); + +private: + void applyImpl() final; + void discardImpl() final { setFromToolchain(); } + bool isDirtyImpl() const final; + void makeReadOnlyImpl() final; + + void setFromToolchain(); + void handleCompilerCommandChange(); + void handlePlatformCodeGenFlagsChange(); + + PathChooser *m_compilerCommand = nullptr; + AbiWidget *m_abiWidget = nullptr; + QLineEdit *m_platformCodeGenFlagsLineEdit = nullptr; + Macros m_macros; +}; + // IarToolChain -IarToolChain::IarToolChain() : - ToolChain(Constants::IAREW_TOOLCHAIN_TYPEID) +class IarToolChain final : public ToolChain { - setTypeDisplayName(Tr::tr("IAREW")); - setTargetAbiKey("TargetAbi"); - setCompilerCommandKey("CompilerPath"); -} +public: + IarToolChain() : ToolChain(Constants::IAREW_TOOLCHAIN_TYPEID) + { + setTypeDisplayName(Tr::tr("IAREW")); + setTargetAbiKey("TargetAbi"); + setCompilerCommandKey("CompilerPath"); + } + + MacroInspectionRunner createMacroInspectionRunner() const final; + + LanguageExtensions languageExtensions(const QStringList &cxxflags) const final; + WarningFlags warningFlags(const QStringList &cxxflags) const final; + + BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(const Environment &) const final; + void addToEnvironment(Environment &env) const final; + QList createOutputParsers() const final; + + QVariantMap toMap() const final; + bool fromMap(const QVariantMap &data) final; + + std::unique_ptr createConfigurationWidget() final; + + bool operator==(const ToolChain &other) const final; + + void setExtraCodeModelFlags(const QStringList &flags); + QStringList extraCodeModelFlags() const final; + + FilePath makeCommand(const Environment &env) const final; + +private: + QStringList m_extraCodeModelFlags; + + friend class IarToolChainFactory; + friend class IarToolChainConfigWidget; +}; ToolChain::MacroInspectionRunner IarToolChain::createMacroInspectionRunner() const { diff --git a/src/plugins/baremetal/iarewtoolchain.h b/src/plugins/baremetal/iarewtoolchain.h index d342c934e49..1b67e9e051f 100644 --- a/src/plugins/baremetal/iarewtoolchain.h +++ b/src/plugins/baremetal/iarewtoolchain.h @@ -3,63 +3,10 @@ #pragma once -#include #include -#include - -QT_BEGIN_NAMESPACE -class QLineEdit; -class QPlainTextEdit; -class QPushButton; -class QTextEdit; -QT_END_NAMESPACE - -namespace Utils { -class FilePath; -class PathChooser; -} - -namespace ProjectExplorer { class AbiWidget; } namespace BareMetal::Internal { -// IarToolChain - -class IarToolChain final : public ProjectExplorer::ToolChain -{ -public: - MacroInspectionRunner createMacroInspectionRunner() const final; - - Utils::LanguageExtensions languageExtensions(const QStringList &cxxflags) const final; - Utils::WarningFlags warningFlags(const QStringList &cxxflags) const final; - - BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(const Utils::Environment &) const final; - void addToEnvironment(Utils::Environment &env) const final; - QList createOutputParsers() const final; - - QVariantMap toMap() const final; - bool fromMap(const QVariantMap &data) final; - - std::unique_ptr createConfigurationWidget() final; - - bool operator ==(const ToolChain &other) const final; - - void setExtraCodeModelFlags(const QStringList &flags); - QStringList extraCodeModelFlags() const final; - - Utils::FilePath makeCommand(const Utils::Environment &env) const final; - -private: - IarToolChain(); - - QStringList m_extraCodeModelFlags; - - friend class IarToolChainFactory; - friend class IarToolChainConfigWidget; -}; - -// IarToolChainFactory - class IarToolChainFactory final : public ProjectExplorer::ToolChainFactory { public: @@ -77,29 +24,4 @@ private: const Candidate &candidate, Utils::Id languageId) const; }; -// IarToolChainConfigWidget - -class IarToolChainConfigWidget final : public ProjectExplorer::ToolChainConfigWidget -{ - Q_OBJECT - -public: - explicit IarToolChainConfigWidget(IarToolChain *tc); - -private: - void applyImpl() final; - void discardImpl() final { setFromToolchain(); } - bool isDirtyImpl() const final; - void makeReadOnlyImpl() final; - - void setFromToolchain(); - void handleCompilerCommandChange(); - void handlePlatformCodeGenFlagsChange(); - - Utils::PathChooser *m_compilerCommand = nullptr; - ProjectExplorer::AbiWidget *m_abiWidget = nullptr; - QLineEdit *m_platformCodeGenFlagsLineEdit = nullptr; - ProjectExplorer::Macros m_macros; -}; - } // BareMetal::Internal