summaryrefslogtreecommitdiff
path: root/src/task.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2022-06-07 18:06:57 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2022-06-09 22:20:31 +0200
commitdafd592cf44c184f9d24e2216bbed5c23e4b23c2 (patch)
treee94ab4c49ec4486e3a8e91c04cbba73a221d54c7 /src/task.h
parent80db51ae3f7d5fbfb52eee4505f615ea4edba62d (diff)
Refactor the way task names are looked up.
Diffstat (limited to 'src/task.h')
-rw-r--r--src/task.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/task.h b/src/task.h
index 47f4d1b..a43e08f 100644
--- a/src/task.h
+++ b/src/task.h
@@ -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;
};