diff options
Diffstat (limited to 'task.cc')
-rw-r--r-- | task.cc | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -8,18 +8,28 @@ Task::Task(const std::vector<std::string>& depends) { } -void Task::registerDepTasks(const std::list<std::shared_ptr<Task>>& tasks) +int Task::registerDepTasks(const std::list<std::shared_ptr<Task>>& tasks) { for(auto const& depStr : dependsStr) { + bool found{false}; for(const auto& task : tasks) { if(task->target() == depStr) { dependsTasks.push_back(task); + found = true; } } + if(!found) + { + std::cerr << "Could not find dependency " << depStr << " needed by " << + target() << " target\n"; + return 1; + } } + + return 0; } bool Task::dirty() |