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 18:11:26 +0100 |
commit | 7b2a17216ec5cb97eeb517863d7336cc04852b43 (patch) | |
tree | 36f90d6f2cdbe8b893c9b5138460ffbdc9a129d8 /src/task_ld.cc | |
parent | dbacf0029104780556af5791f2c6a45edc7a5ec4 (diff) |
WIP
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) { |