diff --git a/src/plugins/ios/iosconfigurations.cpp b/src/plugins/ios/iosconfigurations.cpp index 58607ffbe05..69ccce01de6 100644 --- a/src/plugins/ios/iosconfigurations.cpp +++ b/src/plugins/ios/iosconfigurations.cpp @@ -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; diff --git a/src/plugins/ios/iosconfigurations.h b/src/plugins/ios/iosconfigurations.h index 90a98d862bf..7b65f2f8e6b 100644 --- a/src/plugins/ios/iosconfigurations.h +++ b/src/plugins/ios/iosconfigurations.h @@ -69,15 +69,6 @@ private: using DevelopmentTeamPtr = std::shared_ptr; using DevelopmentTeams = QList; -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 profile); QDebug &operator<<(QDebug &stream, std::shared_ptr team); +void setupIosToolchain(); + } // Ios::Internal diff --git a/src/plugins/ios/iosplugin.cpp b/src/plugins/ios/iosplugin.cpp index 5fddcb899a6..8096d632a78 100644 --- a/src/plugins/ios/iosplugin.cpp +++ b/src/plugins/ios/iosplugin.cpp @@ -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"); + setupIosToolchain(); + IosConfigurations::initialize(); d = new IosPluginPrivate;