summaryrefslogtreecommitdiff
path: root/src/tasks.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2022-05-29 14:55:51 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2022-06-09 22:15:32 +0200
commitb74bd9e24e1205b7449404fd05172664b211d82c (patch)
treeaf69d4efbdddee347cd82c774880efa6820a0aa2 /src/tasks.h
parent15eea63a6e7da37e7b4d643f189e6de150268ff8 (diff)
Make all task lists std::set instead of std::list to make sure to not contain duplicates.
Diffstat (limited to 'src/tasks.h')
-rw-r--r--src/tasks.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/tasks.h b/src/tasks.h
index f2a77d4..c547432 100644
--- a/src/tasks.h
+++ b/src/tasks.h
@@ -4,7 +4,7 @@
#pragma once
#include <string>
-#include <list>
+#include <set>
#include <memory>
#include <deque>
@@ -27,17 +27,17 @@ const std::deque<Target>& getTargets(const Settings& settings,
//! fulfilled.
//! The returned task is removed from the dirty list.
//! Return nullptr if no dirty task is ready.
-std::shared_ptr<Task> getNextTask(const std::list<std::shared_ptr<Task>>& allTasks,
- std::list<std::shared_ptr<Task>>& dirtyTasks);
+std::shared_ptr<Task> getNextTask(const std::set<std::shared_ptr<Task>>& allTasks,
+ std::set<std::shared_ptr<Task>>& dirtyTasks);
//! Get list of tasks filtered by name including each of their direct
//! dependency tasks (ie. objects tasks from their sources).
-std::list<std::shared_ptr<Task>> getTasks(const Settings& settings,
- const std::vector<std::string> names = {},
- bool resolve_externals = true);
+std::set<std::shared_ptr<Task>> getTasks(const Settings& settings,
+ const std::vector<std::string> names = {},
+ bool resolve_externals = true);
//! Generate list of targets from a single configuration, including the final
//! link target and all its objects files (if any).
-std::list<std::shared_ptr<Task>> taskFactory(const BuildConfiguration& config,
- const Settings& settings,
- const std::string& sourceDir);
+std::set<std::shared_ptr<Task>> taskFactory(const BuildConfiguration& config,
+ const Settings& settings,
+ const std::string& sourceDir);