diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2022-06-08 17:38:01 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2022-06-09 22:28:32 +0200 |
commit | 7a16146600384272baf7fb2fc0fc64f59b17ffe9 (patch) | |
tree | 755df6191525a49862d957dc120dcbabcbb03f39 /src/task_fn.h | |
parent | 69d6df33bf7fabe62cdcd61bcd7ebc20b6de6b67 (diff) |
Function target type including support for generated sources.
Diffstat (limited to 'src/task_fn.h')
-rw-r--r-- | src/task_fn.h | 47 |
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; +}; |