summaryrefslogtreecommitdiff
path: root/task_so.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_so.cc
parentc53e622b648635539e4870fd0c9159c5d8c3be4a (diff)
Distinguish between host and target builds.
Diffstat (limited to 'task_so.cc')
-rw-r--r--task_so.cc19
1 files changed, 5 insertions, 14 deletions
diff --git a/task_so.cc b/task_so.cc
index 1f5d204..a60e4c3 100644
--- a/task_so.cc
+++ b/task_so.cc
@@ -64,13 +64,13 @@ TaskSO::TaskSO(const BuildConfiguration& config,
flagsFile += ".flags";
target_type = TargetType::DynamicLibrary;
- _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;
}
}
}
@@ -153,12 +153,7 @@ int TaskSO::runInner()
std::cout << "LD => " << targetFile.string() << "\n";
}
- auto tool = getConfiguration("host-cpp", "/usr/bin/g++");
- if(language() == Language::C)
- {
- tool = getConfiguration("host-cc", "/usr/bin/gcc");
- }
-
+ auto tool = compiler();
return execute(tool, args, settings.verbose > 0);
}
@@ -202,14 +197,10 @@ std::string TaskSO::target() const
std::string TaskSO::flagsString() const
{
- std::string flagsStr;
+ std::string flagsStr = compiler();
for(const auto& flag : config.ldflags)
{
- if(flag != config.ldflags[0])
- {
- flagsStr += " ";
- }
- flagsStr += flag;
+ flagsStr += " " + flag;
}
flagsStr += "\n";