-public:
- Target *create_source(const Component &, const Msp::FS::Path &) const override;
- Target *create_source(const Msp::FS::Path &) const override;
- Target *create_target(const std::list<Target *> &, const std::string & = std::string()) override;
- Target *create_install(Target &) const override;
- std::string create_build_signature(const BuildInfo &) const override;
-};
+template<typename T>
+void Tool::set_run_external(ExternalTask::Arguments (*f)(const T &, Msp::FS::Path &))
+{
+ set_run([f](const Target &t){
+ Msp::FS::Path work_dir = t.get_package()->get_source_directory();
+ ExternalTask::Arguments args = f(dynamic_cast<const T &>(t), work_dir);
+ return new ExternalTask(args, work_dir);
+ });
+}
+
+template<typename T>
+void Tool::set_run_internal(bool (*f)(const T &))
+{
+ set_run([f](const Target &t){
+ const T &ct = dynamic_cast<const T &>(t);
+ return new InternalTask([f, &ct]{ return f(ct); });
+ });
+}