Loading...
Searching...
No Matches
AddonCompiler.hpp
1#pragma once
2
3#include <JitCpp/JitOptions.hpp>
4
5#include <QThread>
6
7#include <score_plugin_jit_export.h>
8
9#include <verdigris>
10
11#include <score/plugins/qt_interfaces/PluginRequirements_QtInterface.hpp>
12#undef RESET
13namespace score
14{
15class Plugin_QtInterface;
16}
17
18namespace Jit
19{
21class AddonCompiler final : public QObject
22{
23 W_OBJECT(AddonCompiler)
24public:
26
28 void submitJob(
29 const std::string& id, std::string cpp, std::vector<std::string> flags,
30 CompilerOptions opts) W_SIGNAL(submitJob, id, cpp, flags, opts);
31 void jobCompleted(score::Plugin_QtInterface* p) W_SIGNAL(jobCompleted, p);
32 void jobFailed() W_SIGNAL(jobFailed);
33 void on_job(
34 std::string id, std::string cpp, std::vector<std::string> flags,
35 CompilerOptions opts);
36
37private:
38 QThread m_thread;
39};
40
41using FactoryFunction = std::function<void()>;
42using CustomCompiler = std::function<FactoryFunction(
43 const std::string&, const std::vector<std::string>&)>;
44}
45
46Q_DECLARE_METATYPE(std::string)
47W_REGISTER_ARGTYPE(std::string)
48Q_DECLARE_METATYPE(std::vector<std::string>)
49W_REGISTER_ARGTYPE(std::vector<std::string>)
50Q_DECLARE_METATYPE(Jit::CompilerOptions)
51W_REGISTER_ARGTYPE(Jit::CompilerOptions)
52Q_DECLARE_METATYPE(score::Plugin_QtInterface*)
53W_REGISTER_ARGTYPE(score::Plugin_QtInterface*)
Compiles jobs asynchronously.
Definition AddonCompiler.hpp:22
Definition PluginRequirements_QtInterface.hpp:18
Base toolkit upon which the software is built.
Definition Application.cpp:90
Definition JitOptions.hpp:7