summaryrefslogtreecommitdiff
path: root/task.h
diff options
context:
space:
mode:
Diffstat (limited to 'task.h')
-rw-r--r--task.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/task.h b/task.h
index 9c2d622..7ea95fc 100644
--- a/task.h
+++ b/task.h
@@ -7,6 +7,8 @@
#include <list>
#include <memory>
+#include "libcppbuild.h"
+
enum class State
{
Unknown,
@@ -19,7 +21,8 @@ enum class State
class Task
{
public:
- Task(const std::vector<std::string>& depends);
+ Task(const BuildConfiguration& config,
+ const std::vector<std::string>& depends = {});
int registerDepTasks(const std::list<std::shared_ptr<Task>>& tasks);
@@ -33,6 +36,11 @@ public:
virtual std::string toJSON() const { return {}; };
+ const BuildConfiguration& buildConfig() const;
+
+ TargetType targetType() const;
+ Language language() const;
+
protected:
std::atomic<State> task_state{State::Unknown};
virtual int runInner() { return 0; };
@@ -40,4 +48,7 @@ protected:
std::vector<std::string> dependsStr;
std::list<std::shared_ptr<Task>> dependsTasks;
+ const BuildConfiguration& config;
+ TargetType target_type{TargetType::Auto};
+ Language _language{Language::Auto};
};