From 794335cf16b3c522b09b10dc5fb02c9554084f8a Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Tue, 4 Feb 2025 19:04:18 +0100 Subject: Add support for custom flags through env: CFLAGS, CXXFLAGS and LDFLAGS --- src/task_so.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/task_so.cc') diff --git a/src/task_so.cc b/src/task_so.cc index c98e4a7..92aeefe 100644 --- a/src/task_so.cc +++ b/src/task_so.cc @@ -116,6 +116,11 @@ int TaskSO::runInner() auto tool = compiler(); const auto& cfg = ctor::get_configuration(); + auto ldflags = cfg.getenv("LDFLAGS"); + if(!ldflags.empty()) + { + append(args, ld_option(toolchain, ctor::ld_opt::custom, ldflags)); + } auto res = execute(settings, tool, args, cfg.env); if(res != 0) { -- cgit v1.2.3