diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2021-06-19 15:41:56 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2021-06-19 15:41:56 +0200 |
commit | 9ae92b4f1d5c24fa9d8d73e6f916b5d6aa01da67 (patch) | |
tree | 5f0610eae0a3d65be8d371aaaa1424466c73f63b /task.cc | |
parent | 0931b80defeffb6b36257ec5f279d661c17fe969 (diff) |
Fail on missing dependecies and trigger re-build if depends list changes in build configurations.
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() |