summaryrefslogtreecommitdiff
path: root/src/task.h
diff options
context:
space:
mode:
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;
};