summaryrefslogtreecommitdiff
path: root/task.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2021-06-20 20:21:58 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2021-06-20 20:21:58 +0200
commitc53e622b648635539e4870fd0c9159c5d8c3be4a (patch)
treea154de97d62e2aad99ccb5498ca7c297ee93623e /task.h
parent4bc1ac3fe2fe3ae96ba0e5aa4d19fa4885a16c83 (diff)
Introduction of configuration generation for controlling tool-chain.
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};
};