summaryrefslogtreecommitdiff
path: root/src/tasks.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2024-12-09 08:32:57 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2024-12-09 08:32:57 +0100
commit5ba36c7be0a12b9b052fb172a209d3b6dffc9a99 (patch)
treea3bc5ffe0766c634e417e40ce6b55f8a2b2ee88d /src/tasks.cc
parent6cc2e195700e6ce02c04160c0c93af6d325d89d7 (diff)
Add support for toolchain specific sourcestoolchain_sources
Diffstat (limited to 'src/tasks.cc')
-rw-r--r--src/tasks.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/tasks.cc b/src/tasks.cc
index a4c455b..0e59097 100644
--- a/src/tasks.cc
+++ b/src/tasks.cc
@@ -92,14 +92,20 @@ std::vector<std::shared_ptr<Task>> taskFactory(const ctor::build_configuration&
}
}
+ const auto& c = ctor::get_configuration();
std::vector<std::string> objects;
if(target_type != ctor::target_type::function)
{
- for(const auto& file : config.sources)
+ for(const auto& source : config.sources)
{
- auto task = std::make_shared<TaskCC>(config, settings, sourceDir, file);
- tasks.push_back(task);
- objects.push_back(task->targetFile().string());
+ 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))
+ {
+ auto task = std::make_shared<TaskCC>(config, settings, sourceDir, source);
+ tasks.push_back(task);
+ objects.push_back(task->targetFile().string());
+ }
}
}
#ifndef BOOTSTRAP