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, 13 insertions, 3 deletions
diff --git a/src/tasks.cc b/src/tasks.cc
index 94fe269..82d044e 100644
--- a/src/tasks.cc
+++ b/src/tasks.cc
@@ -85,7 +85,7 @@ std::vector<std::shared_ptr<Task>> taskFactory(const ctor::build_configuration&
ctor::target_type target_type{config.type};
if(target_type == ctor::target_type::automatic)
{
- if(config.function != nullptr)
+ if(!std::holds_alternative<std::monostate>(config.function))
{
target_type = ctor::target_type::function;
}
@@ -114,12 +114,22 @@ std::vector<std::shared_ptr<Task>> taskFactory(const ctor::build_configuration&
#ifndef BOOTSTRAP
else
{
- for(const auto& file : config.sources)
+ bool multi{std::holds_alternative<ctor::GeneratorCb2>(config.function)};
+ if(multi)
{
- auto task = std::make_shared<TaskFn>(config, settings, sourceDir, file);
+ auto task = std::make_shared<TaskFn>(config, settings, sourceDir, "");
tasks.push_back(task);
objects.push_back(task->target());
}
+ else
+ {
+ for(const auto& file : config.sources)
+ {
+ auto task = std::make_shared<TaskFn>(config, settings, sourceDir, file);
+ tasks.push_back(task);
+ objects.push_back(task->target());
+ }
+ }
}
#endif