diff options
Diffstat (limited to 'src/task_ld.cc')
-rw-r--r-- | src/task_ld.cc | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/task_ld.cc b/src/task_ld.cc index 03745be..af71bbb 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); @@ -129,11 +130,28 @@ int TaskLD::runInner() auto tool = compiler(); const auto& cfg = ctor::get_configuration(); - auto ldflags = cfg.getenv("LDFLAGS"); - if(!ldflags.empty()) + if(toolchain == ctor::toolchain::gcc || + toolchain == ctor::toolchain::clang) { - append(args, ld_option(toolchain, ctor::ld_opt::custom, ldflags)); + auto ldflags = cfg.getenv("LDFLAGS"); + if(!ldflags.empty()) + { + append(args, ld_option(toolchain, ctor::ld_opt::custom, ldflags)); + } } + else // msvc + { + switch(outputSystem()) + { + case ctor::output_system::host: + tool = cfg.get(ctor::cfg::host_ld, "/usr/bin/ld"); + break; + case ctor::output_system::build: + tool = cfg.get(ctor::cfg::build_ld, "/usr/bin/ld"); + break; + } + } + auto res = execute(settings, tool, args, cfg.env, is_self); if(res != 0) { |