summaryrefslogtreecommitdiff
path: root/task_ar.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2021-06-21 21:39:46 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2021-06-21 21:39:46 +0200
commitb25810b9668abe8f7cc7db24326a98c1b017966e (patch)
tree40cda88ffbf8dccfc2d2335783f608966874c58e /task_ar.cc
parentc53e622b648635539e4870fd0c9159c5d8c3be4a (diff)
Distinguish between host and target builds.
Diffstat (limited to 'task_ar.cc')
-rw-r--r--task_ar.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/task_ar.cc b/task_ar.cc
index dca122b..a183102 100644
--- a/task_ar.cc
+++ b/task_ar.cc
@@ -65,13 +65,13 @@ TaskAR::TaskAR(const BuildConfiguration& config,
flagsFile += ".flags";
target_type = TargetType::StaticLibrary;
- _language = Language::C;
+ source_language = Language::C;
for(const auto& source : config.sources)
{
std::filesystem::path sourceFile(source);
if(sourceFile.extension().string() != ".c")
{
- _language = Language::Cpp;
+ source_language = Language::Cpp;
}
}
}
@@ -143,7 +143,17 @@ int TaskAR::runInner()
std::cout << "AR => " << targetFile.string() << "\n";
}
- auto tool = getConfiguration("host-ar", "/usr/bin/ar");
+ std::string tool;
+ switch(outputSystem())
+ {
+ case OutputSystem::Target:
+ tool = getConfiguration(cfg::target_ar, "/usr/bin/ar");
+ break;
+ case OutputSystem::BuildHost:
+ tool = getConfiguration(cfg::host_ar, "/usr/bin/ar");
+ break;
+ }
+
return execute(tool, args, settings.verbose > 0);
}