diff options
| author | Bent Bisballe Nyeng <deva@aasimon.org> | 2025-12-27 15:08:07 +0100 |
|---|---|---|
| committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2026-01-05 22:47:12 +0100 |
| commit | fa99825fa800f0faf4a6e6b1d639b261c7aa43c9 (patch) | |
| tree | 17945e16aa7f33c8aede1694c90a08b7cc05e0e1 /src/tasks.cc | |
| parent | 5ac072c0f42bf3216d16f177c795e9324bf3c52b (diff) | |
Add many-to-one generator function type.develop
Diffstat (limited to 'src/tasks.cc')
| -rw-r--r-- | src/tasks.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/tasks.cc b/src/tasks.cc index 7de8af9..fb7d72b 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& source : config.sources) + bool multi{std::holds_alternative<ctor::GeneratorManyToOne>(config.function)}; + if(multi) { - auto task = std::make_shared<TaskFn>(config, settings, sourceDir, source); + auto task = std::make_shared<TaskFn>(config, settings, sourceDir, ""); tasks.push_back(task); objects.push_back(task->target()); } + else + { + for(const auto& source : config.sources) + { + auto task = std::make_shared<TaskFn>(config, settings, sourceDir, source); + tasks.push_back(task); + objects.push_back(task->target()); + } + } } #endif |
