diff options
Diffstat (limited to 'src/task_so.cc')
-rw-r--r-- | src/task_so.cc | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/task_so.cc b/src/task_so.cc index 93a5ddb..9061591 100644 --- a/src/task_so.cc +++ b/src/task_so.cc @@ -83,17 +83,20 @@ int TaskSO::runInner() std::vector<std::string> args; - append(args, getOption(toolchain, ctor::opt::position_independent_code)); - append(args, getOption(toolchain, ctor::opt::build_shared)); + append(args, ld_option(toolchain, ctor::ld_opt::position_independent_code)); + append(args, ld_option(toolchain, ctor::ld_opt::build_shared)); - append(args, getOption(toolchain, ctor::opt::output, targetFile().string())); + append(args, ld_option(toolchain, ctor::ld_opt::output, targetFile().string())); for(const auto& task : getDependsTasks()) { args.push_back(task->targetFile().string()); } - append(args, config.flags.ldflags); + for(const auto& flag : config.flags.ldflags) + { + append(args, to_strings(toolchain, flag)); + } { // Write flags to file. std::ofstream flagsStream(flagsFile); @@ -159,10 +162,20 @@ bool TaskSO::derived() const std::string TaskSO::flagsString() const { - std::string flagsStr = compiler(); + auto toolchain = getToolChain(config.system); + std::string flagsStr; + bool first{true}; for(const auto& flag : config.flags.ldflags) { - flagsStr += " " + flag; + for(const auto& str : to_strings(toolchain, flag)) + { + if(first) + { + flagsStr += " "; + first = false; + } + flagsStr += str; + } } flagsStr += "\n"; |