From 0d13088ab99cf7d981932451d65034595949ebf8 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Wed, 2 Oct 2024 21:20:40 +0200 Subject: Ensure the initial task order is preserved. Fixes bad ordering during linking. --- src/task.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/task.cc') 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 #include +#include 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>& tasks) +int Task::registerDepTasks(const std::vector>& tasks) { for(const auto& depStr : depends()) { @@ -24,7 +25,10 @@ int Task::registerDepTasks(const std::set>& 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> Task::getDependsTasks() +std::vector> Task::getDependsTasks() { return dependsTasks; } -- cgit v1.2.3