summaryrefslogtreecommitdiff
path: root/src/task_ld.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2024-12-23 12:14:46 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2025-01-09 18:05:20 +0100
commit0ae078c9adae81d2566b86ac645390f75ce4335a (patch)
tree70cc6558c7139df545907a5f00d16fd9f1d30eeb /src/task_ld.cc
parentc50b7554cfd23b53107f2a2917a0be22a68b0c11 (diff)
Diffstat (limited to 'src/task_ld.cc')
-rw-r--r--src/task_ld.cc23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/task_ld.cc b/src/task_ld.cc
index 31ee8c0..9dcbb3a 100644
--- a/src/task_ld.cc
+++ b/src/task_ld.cc
@@ -115,6 +115,7 @@ int TaskLD::runInner()
}
append(args, ld_option(toolchain, ctor::ld_opt::output, targetFile().string()));
+ append(args, to_strings(toolchain, {ctor::toolchain::msvc, ctor::ld_opt::custom, "/nologo"}));
{ // Write flags to file.
std::ofstream flagsStream(flagsFile);
@@ -127,8 +128,27 @@ int TaskLD::runInner()
std::cout << output << std::flush;
}
- auto tool = compiler();
+ std::string tool;
const auto& c = ctor::get_configuration();
+
+ if(toolchain == ctor::toolchain::gcc ||
+ toolchain == ctor::toolchain::clang)
+ {
+ tool = compiler();
+ }
+ else // msvc
+ {
+ switch(outputSystem())
+ {
+ case ctor::output_system::host:
+ tool = c.get(ctor::cfg::host_ld, "/usr/bin/ld");
+ break;
+ case ctor::output_system::build:
+ tool = c.get(ctor::cfg::build_ld, "/usr/bin/ld");
+ break;
+ }
+ }
+
return execute(settings, tool, args, c.env, is_self);
}
@@ -197,7 +217,6 @@ std::string TaskLD::flagsString() const
flagsStr += str;
}
}
- flagsStr += "\n";
for(const auto& dep : config.depends)
{