summaryrefslogtreecommitdiff
path: root/src/task_fn.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/task_fn.h')
-rw-r--r--src/task_fn.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/task_fn.h b/src/task_fn.h
new file mode 100644
index 0000000..e350395
--- /dev/null
+++ b/src/task_fn.h
@@ -0,0 +1,47 @@
+// -*- c++ -*-
+// Distributed under the BSD 2-Clause License.
+// See accompanying file LICENSE for details.
+#pragma once
+
+#include "task.h"
+
+#include <vector>
+#include <string>
+#include <future>
+#include <filesystem>
+
+struct BuildConfiguration;
+struct Settings;
+
+class TaskFn
+ : public Task
+{
+public:
+ TaskFn(const BuildConfiguration& config,
+ const Settings& settings,
+ const std::string& sourceDir, const Source& source);
+ virtual ~TaskFn() = default;
+
+ bool dirtyInner() override;
+
+ int runInner() override;
+ int clean() override;
+
+ std::vector<std::string> depends() const override;
+
+ std::string target() const override;
+ std::filesystem::path targetFile() const override;
+ bool derived() const override;
+
+ std::string toJSON() const override;
+
+ std::string source() const override;
+
+protected:
+ std::filesystem::path sourceFile;
+ std::filesystem::path _targetFile;
+
+ const BuildConfiguration& config;
+ const Settings& settings;
+ std::filesystem::path sourceDir;
+};