summaryrefslogtreecommitdiff
path: root/src/tasks.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/tasks.cc')
-rw-r--r--src/tasks.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/tasks.cc b/src/tasks.cc
index f520772..5e1d235 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 resolved_target_type{config.type};
if(resolved_target_type == ctor::target_type::automatic)
{
- if(!std::holds_alternative<std::monostate>(config.function))
+ if(config.function_one_to_one || config.function_many_to_one)
{
resolved_target_type = ctor::target_type::function;
}
@@ -103,8 +103,10 @@ std::vector<std::shared_ptr<Task>> taskFactory(const ctor::build_configuration&
for(const auto& source : config.sources)
{
if(source.toolchain == ctor::toolchain::any ||
- (config.system == ctor::output_system::build && source.toolchain == c.build_toolchain) ||
- (config.system == ctor::output_system::host && source.toolchain == c.host_toolchain))
+ (config.system == ctor::output_system::build &&
+ source.toolchain == c.build_toolchain) ||
+ (config.system == ctor::output_system::host &&
+ source.toolchain == c.host_toolchain))
{
auto task =
std::make_shared<TaskCC>(ctor::target_type::object, config, settings, sourceDir, source);
@@ -116,8 +118,7 @@ std::vector<std::shared_ptr<Task>> taskFactory(const ctor::build_configuration&
#ifndef BOOTSTRAP
else
{
- bool multi{std::holds_alternative<ctor::GeneratorManyToOne>(config.function)};
- if(multi)
+ if(config.function_many_to_one)
{
auto task =
std::make_shared<TaskFn>(resolved_target_type, config, settings, sourceDir, "");