From 7b493a531decb401ab9b141dd2d7aa7d1338fbdf Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Tue, 27 Jan 2026 19:42:57 +0100 Subject: Clean up target_type usage a bit and add new ctor::target_type::module type. --- src/task_ld.cc | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src/task_ld.cc') diff --git a/src/task_ld.cc b/src/task_ld.cc index a1cff34..2dceb59 100644 --- a/src/task_ld.cc +++ b/src/task_ld.cc @@ -11,25 +11,18 @@ #include "util.h" #include "tools.h" -TaskLD::TaskLD(const ctor::build_configuration& config_, +TaskLD::TaskLD(ctor::target_type resolved_target_type, + const ctor::build_configuration& config_, const ctor::settings& settings_, const std::string& target, const std::vector& objects, const std::string& sourceDir_, bool is_self_) - : Task(config_, settings_, sourceDir_) + : Task(resolved_target_type, config_, settings_, sourceDir_) , config(config_) , settings(settings_) , is_self(is_self_) { - target_type = config.type; - output_system = config.system; - - if(target_type == ctor::target_type::automatic) - { - target_type = ctor::target_type::executable; - } - _targetFile = target; auto toolchain = getToolChain(config.system); _targetFile = extension(toolchain, target_type, config.system, _targetFile); @@ -98,7 +91,7 @@ int TaskLD::runInner() { auto depFile = dep->targetFile(); auto dep_type = target_type_from_extension(toolchain, depFile); - if(dep_type == ctor::target_type::dynamic_library) + if(dep_type == ctor::target_type::shared_library) { append(args, ld_option(toolchain, ctor::ld_opt::library_path, targetFile().parent_path().string())); -- cgit v1.2.3