summaryrefslogtreecommitdiff
path: root/task_ar.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2021-06-20 20:21:58 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2021-06-20 20:21:58 +0200
commitc53e622b648635539e4870fd0c9159c5d8c3be4a (patch)
treea154de97d62e2aad99ccb5498ca7c297ee93623e /task_ar.cc
parent4bc1ac3fe2fe3ae96ba0e5aa4d19fa4885a16c83 (diff)
Introduction of configuration generation for controlling tool-chain.
Diffstat (limited to 'task_ar.cc')
-rw-r--r--task_ar.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/task_ar.cc b/task_ar.cc
index 58223ad..dca122b 100644
--- a/task_ar.cc
+++ b/task_ar.cc
@@ -41,7 +41,7 @@ TaskAR::TaskAR(const BuildConfiguration& config,
const Settings& settings,
const std::string& target,
const std::vector<std::string>& objects)
- : Task(addPrefix(config.depends, settings))
+ : Task(config, addPrefix(config.depends, settings))
, config(config)
, settings(settings)
{
@@ -63,6 +63,17 @@ TaskAR::TaskAR(const BuildConfiguration& config,
flagsFile = settings.builddir / targetFile.stem();
flagsFile += ".flags";
+
+ target_type = TargetType::StaticLibrary;
+ _language = Language::C;
+ for(const auto& source : config.sources)
+ {
+ std::filesystem::path sourceFile(source);
+ if(sourceFile.extension().string() != ".c")
+ {
+ _language = Language::Cpp;
+ }
+ }
}
bool TaskAR::dirtyInner()
@@ -132,7 +143,8 @@ int TaskAR::runInner()
std::cout << "AR => " << targetFile.string() << "\n";
}
- return execute("/usr/bin/ar", args, settings.verbose > 0);
+ auto tool = getConfiguration("host-ar", "/usr/bin/ar");
+ return execute(tool, args, settings.verbose > 0);
}
int TaskAR::clean()