Ios: Use setup function for toolchain factory

Change-Id: I5c78061327fd57acb1e5803a67dd0a619c26a60c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
hjk
2024-01-18 17:58:40 +01:00
parent cb6a2da372
commit c475cdf42d
3 changed files with 19 additions and 14 deletions

View File

@@ -569,11 +569,17 @@ ProvisioningProfilePtr IosConfigurations::provisioningProfile(const QString &pro
equal(&ProvisioningProfile::identifier, profileID)); equal(&ProvisioningProfile::identifier, profileID));
} }
IosToolchainFactory::IosToolchainFactory() class IosToolchainFactory final : public ToolchainFactory
{ {
public:
IosToolchainFactory()
{
setSupportedLanguages({ProjectExplorer::Constants::C_LANGUAGE_ID, setSupportedLanguages({ProjectExplorer::Constants::C_LANGUAGE_ID,
ProjectExplorer::Constants::CXX_LANGUAGE_ID}); ProjectExplorer::Constants::CXX_LANGUAGE_ID});
} }
Toolchains autoDetect(const ToolchainDetector &detector) const final;
};
Toolchains IosToolchainFactory::autoDetect(const ToolchainDetector &detector) const Toolchains IosToolchainFactory::autoDetect(const ToolchainDetector &detector) const
{ {
@@ -612,6 +618,11 @@ Toolchains IosToolchainFactory::autoDetect(const ToolchainDetector &detector) co
return toolChains; return toolChains;
} }
void setupIosToolchain()
{
static IosToolchainFactory theIosToolchainFactory;
}
QString DevelopmentTeam::identifier() const QString DevelopmentTeam::identifier() const
{ {
return m_identifier; return m_identifier;

View File

@@ -69,15 +69,6 @@ private:
using DevelopmentTeamPtr = std::shared_ptr<DevelopmentTeam>; using DevelopmentTeamPtr = std::shared_ptr<DevelopmentTeam>;
using DevelopmentTeams = QList<DevelopmentTeamPtr>; using DevelopmentTeams = QList<DevelopmentTeamPtr>;
class IosToolchainFactory : public ProjectExplorer::ToolchainFactory
{
public:
IosToolchainFactory();
ProjectExplorer::Toolchains autoDetect(
const ProjectExplorer::ToolchainDetector &detector) const final;
};
class IosConfigurations : public QObject class IosConfigurations : public QObject
{ {
Q_OBJECT Q_OBJECT
@@ -123,4 +114,6 @@ private:
QDebug &operator<<(QDebug &stream, std::shared_ptr<ProvisioningProfile> profile); QDebug &operator<<(QDebug &stream, std::shared_ptr<ProvisioningProfile> profile);
QDebug &operator<<(QDebug &stream, std::shared_ptr<DevelopmentTeam> team); QDebug &operator<<(QDebug &stream, std::shared_ptr<DevelopmentTeam> team);
void setupIosToolchain();
} // Ios::Internal } // Ios::Internal

View File

@@ -47,7 +47,6 @@ class IosPluginPrivate
public: public:
IosQmakeBuildConfigurationFactory qmakeBuildConfigurationFactory; IosQmakeBuildConfigurationFactory qmakeBuildConfigurationFactory;
IosCMakeBuildConfigurationFactory cmakeBuildConfigurationFactory; IosCMakeBuildConfigurationFactory cmakeBuildConfigurationFactory;
IosToolchainFactory toolChainFactory;
IosRunConfigurationFactory runConfigurationFactory; IosRunConfigurationFactory runConfigurationFactory;
IosSettingsPage settingsPage; IosSettingsPage settingsPage;
IosQtVersionFactory qtVersionFactory; IosQtVersionFactory qtVersionFactory;
@@ -76,6 +75,8 @@ class IosPlugin final : public ExtensionSystem::IPlugin
{ {
qRegisterMetaType<Ios::IosToolHandler::Dict>("Ios::IosToolHandler::Dict"); qRegisterMetaType<Ios::IosToolHandler::Dict>("Ios::IosToolHandler::Dict");
setupIosToolchain();
IosConfigurations::initialize(); IosConfigurations::initialize();
d = new IosPluginPrivate; d = new IosPluginPrivate;