diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2025-02-01 20:37:32 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2025-02-21 21:42:02 +0100 |
commit | 5809172695f0b174ae036dc829e6d3176d926342 (patch) | |
tree | ad8961645c716da67b913b425cc72534a5d49297 /src/task_ld.cc | |
parent | 8a40f5f49d428bbc89f54144d893a9fa16e3156c (diff) |
WIPmsvc
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) { |