summaryrefslogtreecommitdiff
path: root/src/tasks.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/tasks.cc')
-rw-r--r--src/tasks.cc16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/tasks.cc b/src/tasks.cc
index 1607b37..3113564 100644
--- a/src/tasks.cc
+++ b/src/tasks.cc
@@ -3,6 +3,7 @@
#include <filesystem>
#include <deque>
#include <iostream>
+#include <algorithm>
#include "settings.h"
#include "libctor.h"
@@ -101,6 +102,7 @@ std::list<std::shared_ptr<Task>> taskFactory(const BuildConfiguration& config,
break;
case TargetType::Executable:
+ case TargetType::UnitTest:
tasks.emplace_back(std::make_shared<TaskLD>(config, settings, config.target,
objects));
break;
@@ -111,6 +113,7 @@ std::list<std::shared_ptr<Task>> taskFactory(const BuildConfiguration& config,
return tasks;
}
+}
std::shared_ptr<Task> getNextTask(const std::list<std::shared_ptr<Task>>& allTasks,
std::list<std::shared_ptr<Task>>& dirtyTasks)
@@ -131,15 +134,20 @@ std::shared_ptr<Task> getNextTask(const std::list<std::shared_ptr<Task>>& allTas
return nullptr;
}
-std::list<std::shared_ptr<Task>> getTasks(const Settings& settings)
+std::list<std::shared_ptr<Task>> getTasks(const Settings& settings,
+ const std::vector<std::string> names)
{
auto& targets = getTargets(settings);
std::list<std::shared_ptr<Task>> tasks;
for(const auto& target : targets)
{
- std::vector<std::string> objects;
- auto t = taskFactory(target.config, settings, target.path);
- tasks.insert(tasks.end(), t.begin(), t.end());
+ if(names.empty() ||
+ std::find(std::begin(names), std::end(names), target.config.target) != std::end(names))
+ {
+ std::vector<std::string> objects;
+ auto t = taskFactory(target.config, settings, target.path);
+ tasks.insert(tasks.end(), t.begin(), t.end());
+ }
}
return tasks;