diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2025-04-02 21:54:55 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2025-04-03 08:31:44 +0200 |
commit | ca7b8d7e94e0bef7e56072f02c871bf385f21784 (patch) | |
tree | 2bf16180ecc21a304eaf48afb124ca46da7c679c /src/task_ld.cc | |
parent | cd6c3ea1c3ca853fc38da4fa5fd62545c31aa92d (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) { |