diff options
| author | Bent Bisballe Nyeng <deva@aasimon.org> | 2025-04-02 21:54:55 +0200 |
|---|---|---|
| committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2025-12-29 12:22:47 +0100 |
| commit | 0333f2eca72dfa464a71033363bfd15773718b48 (patch) | |
| tree | 817051e224f074961931dcc451d13e19f93e7377 /src/task_ld.cc | |
| parent | d7f6ce94c5cbdf03e1630c150f2fd34af9f15349 (diff) | |
WIPmsvc
Diffstat (limited to 'src/task_ld.cc')
| -rw-r--r-- | src/task_ld.cc | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/task_ld.cc b/src/task_ld.cc index c7014ff..2808d78 100644 --- a/src/task_ld.cc +++ b/src/task_ld.cc @@ -110,6 +110,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); @@ -124,11 +125,33 @@ int TaskLD::runInner() auto tool = compiler(); const auto& cfg = ctor::get_configuration(); - auto ldflags = cfg.getenv("LDFLAGS"); - if(!ldflags.empty()) + switch(toolchain) { - append(args, ld_option(toolchain, ctor::ld_opt::custom, ldflags)); + case ctor::toolchain::msvc: + switch(outputSystem()) + { + case ctor::output_system::host: + tool = cfg.get(ctor::cfg::host_ld, "link.exe"); + break; + case ctor::output_system::build: + tool = cfg.get(ctor::cfg::build_ld, "link.exe"); + break; + } + break; + case ctor::toolchain::gcc: + case ctor::toolchain::clang: + case ctor::toolchain::any: + case ctor::toolchain::none: + { + auto ldflags = cfg.getenv("LDFLAGS"); + if(!ldflags.empty()) + { + append(args, ld_option(toolchain, ctor::ld_opt::custom, ldflags)); + } + } + break; } + auto res = execute(settings, tool, args, cfg.env, is_self); if(res != 0) { |
