summaryrefslogtreecommitdiff
path: root/src/task.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/task.cc')
-rw-r--r--src/task.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/task.cc b/src/task.cc
index 817ee3a..7813235 100644
--- a/src/task.cc
+++ b/src/task.cc
@@ -5,6 +5,7 @@
#include <unistd.h>
#include <iostream>
+#include <algorithm>
Task::Task(const ctor::build_configuration& config, const ctor::settings& settings,
const std::string& sourceDir)
@@ -15,7 +16,7 @@ Task::Task(const ctor::build_configuration& config, const ctor::settings& settin
{
}
-int Task::registerDepTasks(const std::set<std::shared_ptr<Task>>& tasks)
+int Task::registerDepTasks(const std::vector<std::shared_ptr<Task>>& tasks)
{
for(const auto& depStr : depends())
{
@@ -24,7 +25,10 @@ int Task::registerDepTasks(const std::set<std::shared_ptr<Task>>& tasks)
{
if(*task == depStr)
{
- dependsTasks.insert(task);
+ if(std::find(dependsTasks.begin(), dependsTasks.end(), task) == dependsTasks.end())
+ {
+ dependsTasks.push_back(task);
+ }
found = true;
}
}
@@ -155,7 +159,7 @@ std::string Task::compiler() const
}
}
-std::set<std::shared_ptr<Task>> Task::getDependsTasks()
+std::vector<std::shared_ptr<Task>> Task::getDependsTasks()
{
return dependsTasks;
}