diff options
| author | Bent Bisballe Nyeng <deva@aasimon.org> | 2025-12-20 15:43:47 +0100 |
|---|---|---|
| committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2025-12-20 15:43:47 +0100 |
| commit | f6bcdf67b1b981592825d6a6a1c4d3ff122de553 (patch) | |
| tree | 174c30fb550768ec017b209b5215c66828358279 /src/tasks.cc | |
| parent | 7b6b7df83870c81a3f45107701ddbe52b83f91ab (diff) | |
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 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 |
