WebAssembly: Convert to new plugin setup scheme

Change-Id: I7d5def6084a0cc2cf164a4d72b693b44f8be7005
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
hjk
2023-11-24 15:33:31 +01:00
parent 0afd50aa33
commit e729c37d95
10 changed files with 163 additions and 191 deletions

View File

@@ -26,8 +26,7 @@ using namespace ProjectExplorer;
using namespace QtSupport;
using namespace Utils;
namespace WebAssembly {
namespace Internal {
namespace WebAssembly::Internal {
static const Abi &toolChainAbi()
{
@@ -168,20 +167,28 @@ bool WebAssemblyToolChain::areToolChainsRegistered()
return !ToolchainManager::findToolchains(toolChainAbi()).isEmpty();
}
WebAssemblyToolchainFactory::WebAssemblyToolchainFactory()
class WebAssemblyToolchainFactory final : public ToolchainFactory
{
setDisplayName(Tr::tr("Emscripten"));
setSupportedToolChainType(Constants::WEBASSEMBLY_TOOLCHAIN_TYPEID);
setSupportedLanguages({ProjectExplorer::Constants::C_LANGUAGE_ID,
ProjectExplorer::Constants::CXX_LANGUAGE_ID});
setToolchainConstructor([] { return new WebAssemblyToolChain; });
setUserCreatable(true);
public:
WebAssemblyToolchainFactory()
{
setDisplayName(Tr::tr("Emscripten"));
setSupportedToolChainType(Constants::WEBASSEMBLY_TOOLCHAIN_TYPEID);
setSupportedLanguages({ProjectExplorer::Constants::C_LANGUAGE_ID,
ProjectExplorer::Constants::CXX_LANGUAGE_ID});
setToolchainConstructor([] { return new WebAssemblyToolChain; });
setUserCreatable(true);
}
Toolchains autoDetect(const ToolchainDetector &detector) const
{
return doAutoDetect(detector);
}
};
void setupWebAssemblyToolchain()
{
static WebAssemblyToolchainFactory theWebAssemblyToolchainFactory;
}
Toolchains WebAssemblyToolchainFactory::autoDetect(const ToolchainDetector &detector) const
{
return doAutoDetect(detector);
}
} // namespace Internal
} // namespace WebAssembly
} // WebAssembly::Internal