forked from qt-creator/qt-creator
ProjectExplorer: Use setup function for CustomToolChain
Change-Id: I05eeaad0914285c31928e9fad126b27ad78a0fa6 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
#include "projectexplorerconstants.h"
|
#include "projectexplorerconstants.h"
|
||||||
#include "projectexplorertr.h"
|
#include "projectexplorertr.h"
|
||||||
#include "projectmacro.h"
|
#include "projectmacro.h"
|
||||||
|
#include "toolchain.h"
|
||||||
#include "toolchainconfigwidget.h"
|
#include "toolchainconfigwidget.h"
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
@@ -555,17 +556,24 @@ std::unique_ptr<ToolchainConfigWidget> CustomToolChain::createConfigurationWidge
|
|||||||
return std::make_unique<CustomToolChainConfigWidget>(this);
|
return std::make_unique<CustomToolChainConfigWidget>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
|
||||||
// CustomToolChainFactory
|
// CustomToolChainFactory
|
||||||
// --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
CustomToolchainFactory::CustomToolchainFactory()
|
class CustomToolchainFactory final : public ToolchainFactory
|
||||||
{
|
{
|
||||||
setDisplayName(Tr::tr("Custom"));
|
public:
|
||||||
setSupportedToolchainType(Constants::CUSTOM_TOOLCHAIN_TYPEID);
|
CustomToolchainFactory()
|
||||||
setSupportsAllLanguages(true);
|
{
|
||||||
setToolchainConstructor([] { return new CustomToolChain; });
|
setDisplayName(Tr::tr("Custom"));
|
||||||
setUserCreatable(true);
|
setSupportedToolchainType(Constants::CUSTOM_TOOLCHAIN_TYPEID);
|
||||||
|
setSupportsAllLanguages(true);
|
||||||
|
setToolchainConstructor([] { return new CustomToolChain; });
|
||||||
|
setUserCreatable(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void setupCustomToolchain()
|
||||||
|
{
|
||||||
|
static CustomToolchainFactory theCustomToolchainFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // ProjectExplorer::Internal
|
} // ProjectExplorer::Internal
|
||||||
|
@@ -3,14 +3,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "toolchain.h"
|
|
||||||
|
|
||||||
namespace ProjectExplorer::Internal {
|
namespace ProjectExplorer::Internal {
|
||||||
|
|
||||||
class CustomToolchainFactory : public ToolchainFactory
|
void setupCustomToolchain();
|
||||||
{
|
|
||||||
public:
|
|
||||||
CustomToolchainFactory();
|
|
||||||
};
|
|
||||||
|
|
||||||
} // ProjectExplorer::Interna;
|
} // ProjectExplorer::Interna;
|
||||||
|
@@ -647,8 +647,6 @@ public:
|
|||||||
WinDebugInterface m_winDebugInterface;
|
WinDebugInterface m_winDebugInterface;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CustomToolchainFactory m_customToolChainFactory;
|
|
||||||
|
|
||||||
DesktopDeviceFactory m_desktopDeviceFactory;
|
DesktopDeviceFactory m_desktopDeviceFactory;
|
||||||
|
|
||||||
ToolChainOptionsPage m_toolChainOptionsPage;
|
ToolChainOptionsPage m_toolChainOptionsPage;
|
||||||
@@ -818,6 +816,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
|||||||
setupGccToolchains();
|
setupGccToolchains();
|
||||||
setupMsvcToolchain();
|
setupMsvcToolchain();
|
||||||
setupClangClToolchain();
|
setupClangClToolchain();
|
||||||
|
setupCustomToolchain();
|
||||||
|
|
||||||
setupProjectTreeWidgetFactory();
|
setupProjectTreeWidgetFactory();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user