diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2022-06-07 18:06:57 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2022-06-09 22:20:31 +0200 |
commit | dafd592cf44c184f9d24e2216bbed5c23e4b23c2 (patch) | |
tree | e94ab4c49ec4486e3a8e91c04cbba73a221d54c7 /src/task.h | |
parent | 80db51ae3f7d5fbfb52eee4505f615ea4edba62d (diff) |
Refactor the way task names are looked up.
Diffstat (limited to 'src/task.h')
-rw-r--r-- | src/task.h | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -8,6 +8,7 @@ #include <atomic> #include <set> #include <memory> +#include <filesystem> #include "libctor.h" @@ -20,13 +21,18 @@ enum class State Error, }; +struct Settings; + class Task { public: - Task(const BuildConfiguration& config); + Task(const BuildConfiguration& config, const Settings& settings, + const std::string& sourceDir); int registerDepTasks(const std::set<std::shared_ptr<Task>>& tasks); + bool operator==(const std::string& dep); + virtual std::string name() const; bool dirty(); bool ready(); @@ -34,8 +40,14 @@ public: State state() const; virtual int clean() = 0 ; virtual std::vector<std::string> depends() const = 0; + + //! Raw target name as stated in ctor.cc config file or (in case of a derived + //! target) the calculated target without builddir prefix. virtual std::string target() const = 0; + //! Target file with full path prefix + virtual std::filesystem::path targetFile() const = 0; + //! Returns true for tasks that are non-target tasks, ie. for example derived //! objects files from target sources. virtual bool derived() const = 0; @@ -67,4 +79,6 @@ protected: TargetType target_type{TargetType::Auto}; Language source_language{Language::Auto}; OutputSystem output_system{OutputSystem::Host}; + const Settings& settings; + std::string sourceDir; }; |