forked from qt-creator/qt-creator
BareMetal: Hide SdccToolChain definitions
Not needed publicly. Change-Id: Iee1243c48d0b3308316bb6e7b4f4a34b0551f4ed Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
#include <projectexplorer/abiwidget.h>
|
#include <projectexplorer/abiwidget.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/projectmacro.h>
|
#include <projectexplorer/projectmacro.h>
|
||||||
|
#include <projectexplorer/toolchainconfigwidget.h>
|
||||||
#include <projectexplorer/toolchainmanager.h>
|
#include <projectexplorer/toolchainmanager.h>
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
@@ -168,29 +169,73 @@ static Abi guessAbi(const Macros ¯os)
|
|||||||
guessFormat(arch), guessWordWidth(macros)};
|
guessFormat(arch), guessWordWidth(macros)};
|
||||||
}
|
}
|
||||||
|
|
||||||
static QString buildDisplayName(Abi::Architecture arch, Utils::Id language,
|
static QString buildDisplayName(Abi::Architecture arch, Id language, const QString &version)
|
||||||
const QString &version)
|
|
||||||
{
|
{
|
||||||
const QString archName = Abi::toString(arch);
|
const QString archName = Abi::toString(arch);
|
||||||
const QString langName = ToolChainManager::displayNameOfLanguageId(language);
|
const QString langName = ToolChainManager::displayNameOfLanguageId(language);
|
||||||
return Tr::tr("SDCC %1 (%2, %3)").arg(version, langName, archName);
|
return Tr::tr("SDCC %1 (%2, %3)").arg(version, langName, archName);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Utils::FilePath compilerPathFromEnvironment(const QString &compilerName)
|
static FilePath compilerPathFromEnvironment(const QString &compilerName)
|
||||||
{
|
{
|
||||||
const Environment systemEnvironment = Environment::systemEnvironment();
|
const Environment systemEnvironment = Environment::systemEnvironment();
|
||||||
return systemEnvironment.searchInPath(compilerName);
|
return systemEnvironment.searchInPath(compilerName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SdccToolChainConfigWidget
|
||||||
|
|
||||||
|
class SdccToolChain;
|
||||||
|
|
||||||
|
class SdccToolChainConfigWidget final : public ToolChainConfigWidget
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit SdccToolChainConfigWidget(SdccToolChain *tc);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void applyImpl() final;
|
||||||
|
void discardImpl() final { setFromToolchain(); }
|
||||||
|
bool isDirtyImpl() const final;
|
||||||
|
void makeReadOnlyImpl() final;
|
||||||
|
|
||||||
|
void setFromToolchain();
|
||||||
|
void handleCompilerCommandChange();
|
||||||
|
|
||||||
|
PathChooser *m_compilerCommand = nullptr;
|
||||||
|
AbiWidget *m_abiWidget = nullptr;
|
||||||
|
Macros m_macros;
|
||||||
|
};
|
||||||
|
|
||||||
// SdccToolChain
|
// SdccToolChain
|
||||||
|
|
||||||
SdccToolChain::SdccToolChain() :
|
class SdccToolChain final : public ToolChain
|
||||||
ToolChain(Constants::SDCC_TOOLCHAIN_TYPEID)
|
|
||||||
{
|
{
|
||||||
setTypeDisplayName(Tr::tr("SDCC"));
|
public:
|
||||||
setTargetAbiKey("TargetAbi");
|
SdccToolChain() : ToolChain(Constants::SDCC_TOOLCHAIN_TYPEID)
|
||||||
setCompilerCommandKey("CompilerPath");
|
{
|
||||||
}
|
setTypeDisplayName(Tr::tr("SDCC"));
|
||||||
|
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<OutputLineParser *> createOutputParsers() const final;
|
||||||
|
|
||||||
|
std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() final;
|
||||||
|
|
||||||
|
bool operator==(const ToolChain &other) const final;
|
||||||
|
|
||||||
|
FilePath makeCommand(const Environment &env) const final;
|
||||||
|
|
||||||
|
private:
|
||||||
|
friend class SdccToolChainFactory;
|
||||||
|
friend class SdccToolChainConfigWidget;
|
||||||
|
};
|
||||||
|
|
||||||
ToolChain::MacroInspectionRunner SdccToolChain::createMacroInspectionRunner() const
|
ToolChain::MacroInspectionRunner SdccToolChain::createMacroInspectionRunner() const
|
||||||
{
|
{
|
||||||
@@ -215,7 +260,7 @@ ToolChain::MacroInspectionRunner SdccToolChain::createMacroInspectionRunner() co
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::LanguageExtensions SdccToolChain::languageExtensions(const QStringList &) const
|
LanguageExtensions SdccToolChain::languageExtensions(const QStringList &) const
|
||||||
{
|
{
|
||||||
return LanguageExtension::None;
|
return LanguageExtension::None;
|
||||||
}
|
}
|
||||||
|
@@ -3,52 +3,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <projectexplorer/abi.h>
|
|
||||||
#include <projectexplorer/toolchain.h>
|
#include <projectexplorer/toolchain.h>
|
||||||
#include <projectexplorer/toolchainconfigwidget.h>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
class QPlainTextEdit;
|
|
||||||
class QPushButton;
|
|
||||||
class QTextEdit;
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
namespace Utils { class PathChooser; }
|
|
||||||
|
|
||||||
namespace ProjectExplorer { class AbiWidget; }
|
|
||||||
|
|
||||||
namespace BareMetal::Internal {
|
namespace BareMetal::Internal {
|
||||||
|
|
||||||
// SdccToolChain
|
|
||||||
|
|
||||||
class SdccToolChain 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<Utils::OutputLineParser *> createOutputParsers() const final;
|
|
||||||
|
|
||||||
std::unique_ptr<ProjectExplorer::ToolChainConfigWidget> createConfigurationWidget() final;
|
|
||||||
|
|
||||||
bool operator ==(const ToolChain &other) const final;
|
|
||||||
|
|
||||||
Utils::FilePath makeCommand(const Utils::Environment &env) const final;
|
|
||||||
|
|
||||||
private:
|
|
||||||
SdccToolChain();
|
|
||||||
|
|
||||||
friend class SdccToolChainFactory;
|
|
||||||
friend class SdccToolChainConfigWidget;
|
|
||||||
};
|
|
||||||
|
|
||||||
// SdccToolChainFactory
|
|
||||||
|
|
||||||
class SdccToolChainFactory final : public ProjectExplorer::ToolChainFactory
|
class SdccToolChainFactory final : public ProjectExplorer::ToolChainFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -64,25 +22,4 @@ private:
|
|||||||
const Candidate &candidate, Utils::Id language) const;
|
const Candidate &candidate, Utils::Id language) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
// SdccToolChainConfigWidget
|
|
||||||
|
|
||||||
class SdccToolChainConfigWidget final : public ProjectExplorer::ToolChainConfigWidget
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
explicit SdccToolChainConfigWidget(SdccToolChain *tc);
|
|
||||||
|
|
||||||
private:
|
|
||||||
void applyImpl() final;
|
|
||||||
void discardImpl() final { setFromToolchain(); }
|
|
||||||
bool isDirtyImpl() const final;
|
|
||||||
void makeReadOnlyImpl() final;
|
|
||||||
|
|
||||||
void setFromToolchain();
|
|
||||||
void handleCompilerCommandChange();
|
|
||||||
|
|
||||||
Utils::PathChooser *m_compilerCommand = nullptr;
|
|
||||||
ProjectExplorer::AbiWidget *m_abiWidget = nullptr;
|
|
||||||
ProjectExplorer::Macros m_macros;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // BareMetal::Internal
|
} // BareMetal::Internal
|
||||||
|
Reference in New Issue
Block a user