diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2024-10-02 21:20:40 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2024-10-03 12:06:38 +0200 |
commit | 0008920eed996009068fe9f71512c436577b6220 (patch) | |
tree | 60350de98747a63e1739841b966269f5e312b9ba /src/task_cc.cc | |
parent | a38c6682e4fb1f45aa1f37d10c2480aa517ea3bc (diff) |
Ensure the initial task order is preserved. Fixes bad ordering during linking.
Diffstat (limited to 'src/task_cc.cc')
-rw-r--r-- | src/task_cc.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/task_cc.cc b/src/task_cc.cc index 294c5ea..4eb07ae 100644 --- a/src/task_cc.cc +++ b/src/task_cc.cc @@ -6,6 +6,7 @@ #include <iostream> #include <fstream> #include <cassert> +#include <algorithm> #include "ctor.h" #include "execute.h" @@ -72,13 +73,16 @@ TaskCC::TaskCC(const ctor::build_configuration& config, const ctor::settings& se std::filesystem::create_directories(targetFile().parent_path()); } -int TaskCC::registerDepTasksInner(const std::set<std::shared_ptr<Task>>& tasks) +int TaskCC::registerDepTasksInner(const std::vector<std::shared_ptr<Task>>& tasks) { for(const auto& task : tasks) { if(*task == _source.file) { - dependsTasks.insert(task); + if(std::find(dependsTasks.begin(), dependsTasks.end(), task) == dependsTasks.end()) + { + dependsTasks.push_back(task); + } } } |