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));
}
IosToolchainFactory::IosToolchainFactory()
class IosToolchainFactory final : public ToolchainFactory
{
setSupportedLanguages({ProjectExplorer::Constants::C_LANGUAGE_ID,
ProjectExplorer::Constants::CXX_LANGUAGE_ID});
}
public:
IosToolchainFactory()
{
setSupportedLanguages({ProjectExplorer::Constants::C_LANGUAGE_ID,
ProjectExplorer::Constants::CXX_LANGUAGE_ID});
}
Toolchains autoDetect(const ToolchainDetector &detector) const final;
};
Toolchains IosToolchainFactory::autoDetect(const ToolchainDetector &detector) const
{
@@ -612,6 +618,11 @@ Toolchains IosToolchainFactory::autoDetect(const ToolchainDetector &detector) co
return toolChains;
}
void setupIosToolchain()
{
static IosToolchainFactory theIosToolchainFactory;
}
QString DevelopmentTeam::identifier() const
{
return m_identifier;

View File

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

View File

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