summaryrefslogtreecommitdiff
path: root/src/task_so.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/task_so.cc')
-rw-r--r--src/task_so.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/task_so.cc b/src/task_so.cc
index 2bd27c4..8c6dbd4 100644
--- a/src/task_so.cc
+++ b/src/task_so.cc
@@ -9,6 +9,7 @@
#include "libctor.h"
#include "execute.h"
#include "util.h"
+#include "tools.h"
TaskSO::TaskSO(const BuildConfiguration& config,
const Settings& settings,
@@ -78,23 +79,21 @@ bool TaskSO::dirtyInner()
int TaskSO::runInner()
{
+ auto tool_chain = getToolChain(config.system);
+
std::vector<std::string> args;
- args.push_back("-fPIC");
- args.push_back("-shared");
+ append(args, getOption(tool_chain, opt::position_independent_code));
+ append(args, getOption(tool_chain, opt::build_shared));
- args.push_back("-o");
- args.push_back(targetFile().string());
+ append(args, getOption(tool_chain, opt::output, targetFile().string()));
for(const auto& task : getDependsTasks())
{
args.push_back(task->targetFile().string());
}
- for(const auto& flag : config.flags.ldflags)
- {
- args.push_back(flag);
- }
+ append(args, config.flags.ldflags);
{ // Write flags to file.
std::ofstream flagsStream(flagsFile);