summaryrefslogtreecommitdiff
path: root/src/build.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/build.cc')
-rw-r--r--src/build.cc21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/build.cc b/src/build.cc
index 8adbc54..b0b4d06 100644
--- a/src/build.cc
+++ b/src/build.cc
@@ -9,13 +9,14 @@
#include <chrono>
#include <set>
#include <thread>
+#include <list>
using namespace std::chrono_literals;
int build(const Settings& settings,
const std::string& name,
- const std::list<std::shared_ptr<Task>>& tasks,
- const std::list<std::shared_ptr<Task>>& all_tasks,
+ const std::set<std::shared_ptr<Task>>& tasks,
+ const std::set<std::shared_ptr<Task>>& all_tasks,
bool dryrun)
{
if(settings.verbose > 1)
@@ -23,12 +24,12 @@ int build(const Settings& settings,
std::cout << "Building '" << name << "'\n";
}
- std::list<std::shared_ptr<Task>> dirtyTasks;
+ std::set<std::shared_ptr<Task>> dirtyTasks;
for(auto task : tasks)
{
if(task->dirty())
{
- dirtyTasks.push_back(task);
+ dirtyTasks.insert(task);
}
}
@@ -155,7 +156,7 @@ std::set<std::shared_ptr<Task>> getDepTasks(std::shared_ptr<Task> task)
int build(const Settings& settings,
const std::string& name,
- const std::list<std::shared_ptr<Task>>& all_tasks,
+ const std::set<std::shared_ptr<Task>>& all_tasks,
bool dryrun)
{
bool task_found{false};
@@ -172,10 +173,10 @@ int build(const Settings& settings,
task_found = true;
auto depSet = getDepTasks(task);
- std::list<std::shared_ptr<Task>> ts;
+ std::set<std::shared_ptr<Task>> ts;
for(const auto& task : depSet)
{
- ts.push_back(task);
+ ts.insert(task);
}
auto ret = build(settings, name, ts, all_tasks, dryrun);
@@ -200,11 +201,11 @@ int build(const Settings& settings,
int build(const Settings& settings,
const std::string& name,
const std::vector<Target>& targets,
- const std::list<std::shared_ptr<Task>>& all_tasks,
+ const std::set<std::shared_ptr<Task>>& all_tasks,
bool dryrun)
{
bool task_found{false};
- std::list<std::shared_ptr<Task>> ts;
+ std::set<std::shared_ptr<Task>> ts;
for(const auto& target : targets)
{
@@ -218,7 +219,7 @@ int build(const Settings& settings,
auto depSet = getDepTasks(task);
for(const auto& task : depSet)
{
- ts.push_back(task);
+ ts.insert(task);
}
}
}