forked from qt-creator/qt-creator
WebAssembly: Convert to new plugin setup scheme
Change-Id: I7d5def6084a0cc2cf164a4d72b693b44f8be7005 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -5,14 +5,19 @@
|
|||||||
#include "webassemblydevice.h"
|
#include "webassemblydevice.h"
|
||||||
#include "webassemblytr.h"
|
#include "webassemblytr.h"
|
||||||
|
|
||||||
|
#include <projectexplorer/devicesupport/desktopdevice.h>
|
||||||
|
#include <projectexplorer/devicesupport/idevicefactory.h>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
namespace WebAssembly {
|
namespace WebAssembly::Internal {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
WebAssemblyDevice::WebAssemblyDevice()
|
class WebAssemblyDevice final : public DesktopDevice
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
WebAssemblyDevice()
|
||||||
|
{
|
||||||
setupId(IDevice::AutoDetected, Constants::WEBASSEMBLY_DEVICE_DEVICE_ID);
|
setupId(IDevice::AutoDetected, Constants::WEBASSEMBLY_DEVICE_DEVICE_ID);
|
||||||
setType(Constants::WEBASSEMBLY_DEVICE_TYPE);
|
setType(Constants::WEBASSEMBLY_DEVICE_TYPE);
|
||||||
const QString displayNameAndType = Tr::tr("Web Browser");
|
const QString displayNameAndType = Tr::tr("Web Browser");
|
||||||
@@ -22,22 +27,31 @@ WebAssemblyDevice::WebAssemblyDevice()
|
|||||||
setMachineType(IDevice::Hardware);
|
setMachineType(IDevice::Hardware);
|
||||||
setOsType(OsTypeOther);
|
setOsType(OsTypeOther);
|
||||||
setFileAccess(nullptr);
|
setFileAccess(nullptr);
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
IDevice::Ptr WebAssemblyDevice::create()
|
IDevicePtr createWebAssemblyDevice()
|
||||||
{
|
{
|
||||||
return IDevicePtr(new WebAssemblyDevice);
|
return IDevicePtr(new WebAssemblyDevice);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebAssemblyDeviceFactory::WebAssemblyDeviceFactory()
|
class WebAssemblyDeviceFactory final : public IDeviceFactory
|
||||||
: ProjectExplorer::IDeviceFactory(Constants::WEBASSEMBLY_DEVICE_TYPE)
|
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
WebAssemblyDeviceFactory()
|
||||||
|
: IDeviceFactory(Constants::WEBASSEMBLY_DEVICE_TYPE)
|
||||||
|
{
|
||||||
setDisplayName(Tr::tr("WebAssembly Runtime"));
|
setDisplayName(Tr::tr("WebAssembly Runtime"));
|
||||||
setCombinedIcon(":/webassembly/images/webassemblydevicesmall.png",
|
setCombinedIcon(":/webassembly/images/webassemblydevicesmall.png",
|
||||||
":/webassembly/images/webassemblydevice.png");
|
":/webassembly/images/webassemblydevice.png");
|
||||||
setConstructionFunction(&WebAssemblyDevice::create);
|
setConstructionFunction(&createWebAssemblyDevice);
|
||||||
setCreator(&WebAssemblyDevice::create);
|
setCreator(&createWebAssemblyDevice);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void setupWebAssemblyDevice()
|
||||||
|
{
|
||||||
|
static WebAssemblyDeviceFactory theWebAssemblyDeviceFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // WebAssembly::Internal
|
||||||
} // namespace WebAssembly
|
|
||||||
|
|||||||
@@ -3,26 +3,12 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <projectexplorer/devicesupport/desktopdevice.h>
|
#include <projectexplorer/devicesupport/idevicefwd.h>
|
||||||
#include <projectexplorer/devicesupport/idevicefactory.h>
|
|
||||||
|
|
||||||
namespace WebAssembly {
|
namespace WebAssembly::Internal {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class WebAssemblyDevice final : public ProjectExplorer::DesktopDevice
|
ProjectExplorer::IDevicePtr createWebAssemblyDevice();
|
||||||
{
|
|
||||||
public:
|
|
||||||
static ProjectExplorer::IDevice::Ptr create();
|
|
||||||
|
|
||||||
private:
|
void setupWebAssemblyDevice();
|
||||||
WebAssemblyDevice();
|
|
||||||
};
|
|
||||||
|
|
||||||
class WebAssemblyDeviceFactory final : public ProjectExplorer::IDeviceFactory
|
} // WebAssembly::Interenal
|
||||||
{
|
|
||||||
public:
|
|
||||||
WebAssemblyDeviceFactory();
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace WebAssembly
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
#include "webassemblydevice.h"
|
#include "webassemblydevice.h"
|
||||||
#include "webassemblyqtversion.h"
|
#include "webassemblyqtversion.h"
|
||||||
#include "webassemblyrunconfiguration.h"
|
#include "webassemblyrunconfiguration.h"
|
||||||
#include "webassemblysettings.h"
|
|
||||||
#include "webassemblytoolchain.h"
|
#include "webassemblytoolchain.h"
|
||||||
#include "webassemblytr.h"
|
#include "webassemblytr.h"
|
||||||
|
|
||||||
@@ -18,6 +17,8 @@
|
|||||||
#include <coreplugin/icontext.h>
|
#include <coreplugin/icontext.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
|
#include <extensionsystem/iplugin.h>
|
||||||
|
|
||||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||||
#include <projectexplorer/kitmanager.h>
|
#include <projectexplorer/kitmanager.h>
|
||||||
|
|
||||||
@@ -31,47 +32,7 @@ using namespace Utils;
|
|||||||
|
|
||||||
namespace WebAssembly::Internal {
|
namespace WebAssembly::Internal {
|
||||||
|
|
||||||
class WebAssemblyPluginPrivate
|
static void askUserAboutEmSdkSetup()
|
||||||
{
|
|
||||||
public:
|
|
||||||
WebAssemblyToolchainFactory toolChainFactory;
|
|
||||||
WebAssemblyDeviceFactory deviceFactory;
|
|
||||||
WebAssemblyQtVersionFactory qtVersionFactory;
|
|
||||||
EmrunRunConfigurationFactory emrunRunConfigurationFactory;
|
|
||||||
EmrunRunWorkerFactory emrunRunWorkerFactory;
|
|
||||||
};
|
|
||||||
|
|
||||||
static WebAssemblyPluginPrivate *dd = nullptr;
|
|
||||||
|
|
||||||
WebAssemblyPlugin::WebAssemblyPlugin()
|
|
||||||
{
|
|
||||||
setObjectName("WebAssemblyPlugin");
|
|
||||||
}
|
|
||||||
|
|
||||||
WebAssemblyPlugin::~WebAssemblyPlugin()
|
|
||||||
{
|
|
||||||
delete dd;
|
|
||||||
dd = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void WebAssemblyPlugin::initialize()
|
|
||||||
{
|
|
||||||
dd = new WebAssemblyPluginPrivate;
|
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
|
||||||
addTest<WebAssemblyTest>();
|
|
||||||
#endif // WITH_TESTS
|
|
||||||
}
|
|
||||||
|
|
||||||
void WebAssemblyPlugin::extensionsInitialized()
|
|
||||||
{
|
|
||||||
connect(KitManager::instance(), &KitManager::kitsLoaded, this, [] {
|
|
||||||
DeviceManager::instance()->addDevice(WebAssemblyDevice::create());
|
|
||||||
askUserAboutEmSdkSetup();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void WebAssemblyPlugin::askUserAboutEmSdkSetup()
|
|
||||||
{
|
{
|
||||||
const char setupWebAssemblyEmSdk[] = "SetupWebAssemblyEmSdk";
|
const char setupWebAssemblyEmSdk[] = "SetupWebAssemblyEmSdk";
|
||||||
|
|
||||||
@@ -91,4 +52,32 @@ void WebAssemblyPlugin::askUserAboutEmSdkSetup()
|
|||||||
ICore::infoBar()->addInfo(info);
|
ICore::infoBar()->addInfo(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class WebAssemblyPlugin final : public ExtensionSystem::IPlugin
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "WebAssembly.json")
|
||||||
|
|
||||||
|
public:
|
||||||
|
void initialize() final
|
||||||
|
{
|
||||||
|
setupWebAssemblyToolchain();
|
||||||
|
setupWebAssemblyDevice();
|
||||||
|
setupWebAssemblyQtVersion();
|
||||||
|
setupEmrunRunSupport();
|
||||||
|
|
||||||
|
#ifdef WITH_TESTS
|
||||||
|
addTest<WebAssemblyTest>();
|
||||||
|
#endif // WITH_TESTS
|
||||||
|
}
|
||||||
|
void extensionsInitialized() final
|
||||||
|
{
|
||||||
|
connect(KitManager::instance(), &KitManager::kitsLoaded, this, [] {
|
||||||
|
DeviceManager::instance()->addDevice(createWebAssemblyDevice());
|
||||||
|
askUserAboutEmSdkSetup();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
} // WebAssembly::Internal
|
} // WebAssembly::Internal
|
||||||
|
|
||||||
|
#include "webassemblyplugin.moc"
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
// Copyright (C) 2020 The Qt Company Ltd.
|
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <extensionsystem/iplugin.h>
|
|
||||||
|
|
||||||
namespace WebAssembly::Internal {
|
|
||||||
|
|
||||||
class WebAssemblyPlugin : public ExtensionSystem::IPlugin
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "WebAssembly.json")
|
|
||||||
|
|
||||||
public:
|
|
||||||
WebAssemblyPlugin();
|
|
||||||
~WebAssemblyPlugin() override;
|
|
||||||
|
|
||||||
void initialize() override;
|
|
||||||
void extensionsInitialized() override;
|
|
||||||
static void askUserAboutEmSdkSetup();
|
|
||||||
};
|
|
||||||
|
|
||||||
} // WebAssembly::Internal
|
|
||||||
|
|||||||
@@ -1,17 +1,22 @@
|
|||||||
// Copyright (C) 2020 The Qt Company Ltd.
|
// Copyright (C) 2020 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||||
|
|
||||||
#include "webassemblyconstants.h"
|
|
||||||
#include "webassemblyqtversion.h"
|
#include "webassemblyqtversion.h"
|
||||||
|
|
||||||
|
#include "webassemblyconstants.h"
|
||||||
#include "webassemblytr.h"
|
#include "webassemblytr.h"
|
||||||
|
|
||||||
|
#include <coreplugin/featureprovider.h>
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
#include <projectexplorer/abi.h>
|
#include <projectexplorer/abi.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <remotelinux/remotelinux_constants.h>
|
|
||||||
#include <coreplugin/featureprovider.h>
|
#include <qtsupport/qtversionfactory.h>
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <qtsupport/qtversionmanager.h>
|
#include <qtsupport/qtversionmanager.h>
|
||||||
|
|
||||||
|
#include <remotelinux/remotelinux_constants.h>
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
@@ -22,8 +27,7 @@
|
|||||||
using namespace QtSupport;
|
using namespace QtSupport;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
namespace WebAssembly {
|
namespace WebAssembly::Internal {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
WebAssemblyQtVersion::WebAssemblyQtVersion() = default;
|
WebAssemblyQtVersion::WebAssemblyQtVersion() = default;
|
||||||
|
|
||||||
@@ -37,16 +41,6 @@ QSet<Id> WebAssemblyQtVersion::targetDeviceTypes() const
|
|||||||
return {Constants::WEBASSEMBLY_DEVICE_TYPE};
|
return {Constants::WEBASSEMBLY_DEVICE_TYPE};
|
||||||
}
|
}
|
||||||
|
|
||||||
WebAssemblyQtVersionFactory::WebAssemblyQtVersionFactory()
|
|
||||||
{
|
|
||||||
setQtVersionCreator([] { return new WebAssemblyQtVersion; });
|
|
||||||
setSupportedType(Constants::WEBASSEMBLY_QT_VERSION);
|
|
||||||
setPriority(1);
|
|
||||||
setRestrictionChecker([](const SetupData &setup) {
|
|
||||||
return setup.platforms.contains("wasm");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
bool WebAssemblyQtVersion::isValid() const
|
bool WebAssemblyQtVersion::isValid() const
|
||||||
{
|
{
|
||||||
return QtVersion::isValid() && qtVersion() >= minimumSupportedQtVersion();
|
return QtVersion::isValid() && qtVersion() >= minimumSupportedQtVersion();
|
||||||
@@ -84,5 +78,23 @@ bool WebAssemblyQtVersion::isUnsupportedQtVersionInstalled()
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
class WebAssemblyQtVersionFactory final : public QtVersionFactory
|
||||||
} // namespace WebAssembly
|
{
|
||||||
|
public:
|
||||||
|
WebAssemblyQtVersionFactory()
|
||||||
|
{
|
||||||
|
setQtVersionCreator([] { return new WebAssemblyQtVersion; });
|
||||||
|
setSupportedType(Constants::WEBASSEMBLY_QT_VERSION);
|
||||||
|
setPriority(1);
|
||||||
|
setRestrictionChecker([](const SetupData &setup) {
|
||||||
|
return setup.platforms.contains("wasm");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void setupWebAssemblyQtVersion()
|
||||||
|
{
|
||||||
|
static WebAssemblyQtVersionFactory theWebAssemblyQtVersionFactory;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // WebAssembly::Internal
|
||||||
|
|||||||
@@ -3,34 +3,27 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <qtsupport/qtversionfactory.h>
|
|
||||||
#include <qtsupport/baseqtversion.h>
|
#include <qtsupport/baseqtversion.h>
|
||||||
|
|
||||||
namespace WebAssembly {
|
namespace WebAssembly::Internal {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class WebAssemblyQtVersion : public QtSupport::QtVersion
|
class WebAssemblyQtVersion final : public QtSupport::QtVersion
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WebAssemblyQtVersion();
|
WebAssemblyQtVersion();
|
||||||
|
|
||||||
QString description() const override;
|
QString description() const final;
|
||||||
|
|
||||||
QSet<Utils::Id> targetDeviceTypes() const override;
|
QSet<Utils::Id> targetDeviceTypes() const final;
|
||||||
|
|
||||||
bool isValid() const override;
|
bool isValid() const final;
|
||||||
QString invalidReason() const override;
|
QString invalidReason() const final;
|
||||||
|
|
||||||
static const QVersionNumber &minimumSupportedQtVersion();
|
static const QVersionNumber &minimumSupportedQtVersion();
|
||||||
static bool isQtVersionInstalled();
|
static bool isQtVersionInstalled();
|
||||||
static bool isUnsupportedQtVersionInstalled();
|
static bool isUnsupportedQtVersionInstalled();
|
||||||
};
|
};
|
||||||
|
|
||||||
class WebAssemblyQtVersionFactory : public QtSupport::QtVersionFactory
|
void setupWebAssemblyQtVersion();
|
||||||
{
|
|
||||||
public:
|
|
||||||
WebAssemblyQtVersionFactory();
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
} // WebAssembly::Internal
|
||||||
} // namespace WebAssembly
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/runconfigurationaspects.h>
|
#include <projectexplorer/runconfigurationaspects.h>
|
||||||
|
#include <projectexplorer/runconfiguration.h>
|
||||||
#include <projectexplorer/runcontrol.h>
|
#include <projectexplorer/runcontrol.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
|
|
||||||
@@ -221,17 +222,31 @@ public:
|
|||||||
|
|
||||||
// Factories
|
// Factories
|
||||||
|
|
||||||
EmrunRunConfigurationFactory::EmrunRunConfigurationFactory()
|
class EmrunRunConfigurationFactory final : public ProjectExplorer::RunConfigurationFactory
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
EmrunRunConfigurationFactory()
|
||||||
|
{
|
||||||
registerRunConfiguration<EmrunRunConfiguration>(Constants::WEBASSEMBLY_RUNCONFIGURATION_EMRUN);
|
registerRunConfiguration<EmrunRunConfiguration>(Constants::WEBASSEMBLY_RUNCONFIGURATION_EMRUN);
|
||||||
addSupportedTargetDeviceType(Constants::WEBASSEMBLY_DEVICE_TYPE);
|
addSupportedTargetDeviceType(Constants::WEBASSEMBLY_DEVICE_TYPE);
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
EmrunRunWorkerFactory::EmrunRunWorkerFactory()
|
class EmrunRunWorkerFactory final : public ProjectExplorer::RunWorkerFactory
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
EmrunRunWorkerFactory()
|
||||||
|
{
|
||||||
setProduct<EmrunRunWorker>();
|
setProduct<EmrunRunWorker>();
|
||||||
addSupportedRunMode(ProjectExplorer::Constants::NORMAL_RUN_MODE);
|
addSupportedRunMode(ProjectExplorer::Constants::NORMAL_RUN_MODE);
|
||||||
addSupportedRunConfig(Constants::WEBASSEMBLY_RUNCONFIGURATION_EMRUN);
|
addSupportedRunConfig(Constants::WEBASSEMBLY_RUNCONFIGURATION_EMRUN);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void setupEmrunRunSupport()
|
||||||
|
{
|
||||||
|
static EmrunRunConfigurationFactory theEmrunRunConfigurationFactory;
|
||||||
|
static EmrunRunWorkerFactory theEmrunRunWorkerFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // Webassembly::Internal
|
} // Webassembly::Internal
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <projectexplorer/runconfiguration.h>
|
#include <QList>
|
||||||
#include <projectexplorer/runcontrol.h>
|
#include <QString>
|
||||||
|
|
||||||
namespace WebAssembly::Internal {
|
namespace WebAssembly::Internal {
|
||||||
|
|
||||||
@@ -13,17 +13,6 @@ using WebBrowserEntries = QList<WebBrowserEntry>;
|
|||||||
|
|
||||||
WebBrowserEntries parseEmrunOutput(const QByteArray &output);
|
WebBrowserEntries parseEmrunOutput(const QByteArray &output);
|
||||||
|
|
||||||
|
void setupEmrunRunSupport();
|
||||||
class EmrunRunConfigurationFactory final : public ProjectExplorer::RunConfigurationFactory
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
EmrunRunConfigurationFactory();
|
|
||||||
};
|
|
||||||
|
|
||||||
class EmrunRunWorkerFactory final : public ProjectExplorer::RunWorkerFactory
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
EmrunRunWorkerFactory();
|
|
||||||
};
|
|
||||||
|
|
||||||
} // Webassembly::Internal
|
} // Webassembly::Internal
|
||||||
|
|||||||
@@ -26,8 +26,7 @@ using namespace ProjectExplorer;
|
|||||||
using namespace QtSupport;
|
using namespace QtSupport;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
namespace WebAssembly {
|
namespace WebAssembly::Internal {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
static const Abi &toolChainAbi()
|
static const Abi &toolChainAbi()
|
||||||
{
|
{
|
||||||
@@ -168,20 +167,28 @@ bool WebAssemblyToolChain::areToolChainsRegistered()
|
|||||||
return !ToolchainManager::findToolchains(toolChainAbi()).isEmpty();
|
return !ToolchainManager::findToolchains(toolChainAbi()).isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
WebAssemblyToolchainFactory::WebAssemblyToolchainFactory()
|
class WebAssemblyToolchainFactory final : public ToolchainFactory
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
WebAssemblyToolchainFactory()
|
||||||
|
{
|
||||||
setDisplayName(Tr::tr("Emscripten"));
|
setDisplayName(Tr::tr("Emscripten"));
|
||||||
setSupportedToolChainType(Constants::WEBASSEMBLY_TOOLCHAIN_TYPEID);
|
setSupportedToolChainType(Constants::WEBASSEMBLY_TOOLCHAIN_TYPEID);
|
||||||
setSupportedLanguages({ProjectExplorer::Constants::C_LANGUAGE_ID,
|
setSupportedLanguages({ProjectExplorer::Constants::C_LANGUAGE_ID,
|
||||||
ProjectExplorer::Constants::CXX_LANGUAGE_ID});
|
ProjectExplorer::Constants::CXX_LANGUAGE_ID});
|
||||||
setToolchainConstructor([] { return new WebAssemblyToolChain; });
|
setToolchainConstructor([] { return new WebAssemblyToolChain; });
|
||||||
setUserCreatable(true);
|
setUserCreatable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Toolchains WebAssemblyToolchainFactory::autoDetect(const ToolchainDetector &detector) const
|
Toolchains autoDetect(const ToolchainDetector &detector) const
|
||||||
{
|
{
|
||||||
return doAutoDetect(detector);
|
return doAutoDetect(detector);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void setupWebAssemblyToolchain()
|
||||||
|
{
|
||||||
|
static WebAssemblyToolchainFactory theWebAssemblyToolchainFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // WebAssembly::Internal
|
||||||
} // namespace WebAssembly
|
|
||||||
|
|||||||
@@ -7,8 +7,7 @@
|
|||||||
|
|
||||||
#include <QVersionNumber>
|
#include <QVersionNumber>
|
||||||
|
|
||||||
namespace WebAssembly {
|
namespace WebAssembly::Internal {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class WebAssemblyToolChain final : public ProjectExplorer::GccToolChain
|
class WebAssemblyToolChain final : public ProjectExplorer::GccToolChain
|
||||||
{
|
{
|
||||||
@@ -25,14 +24,6 @@ public:
|
|||||||
static bool areToolChainsRegistered();
|
static bool areToolChainsRegistered();
|
||||||
};
|
};
|
||||||
|
|
||||||
class WebAssemblyToolchainFactory : public ProjectExplorer::ToolchainFactory
|
void setupWebAssemblyToolchain();
|
||||||
{
|
|
||||||
public:
|
|
||||||
WebAssemblyToolchainFactory();
|
|
||||||
|
|
||||||
ProjectExplorer::Toolchains autoDetect(
|
} // WebAssembly::Internal
|
||||||
const ProjectExplorer::ToolchainDetector &detector) const final;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace WebAssembly
|
|
||||||
|
|||||||
Reference in New Issue
Block a user