From e515d5bcc23ee9b8dda615540a77fd291c2b52ee Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 6 Sep 2025 19:58:47 +0800 Subject: add build.linker.output --- xmake/modules/core/tools/gcc.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'xmake/modules') diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index 7062e335f..ed8bebdbc 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -937,6 +937,13 @@ end function link(self, objectfiles, targetkind, targetfile, flags, opt) opt = opt or {} + -- enable linker output? + local target = opt.target + local linker_output = option.get("verbose") + if linker_output == nil and target and target.policy and target:policy("build.linker.output") then + linker_output = true + end + os.mkdir(path.directory(targetfile)) local implibfile = _get_implibfile(self, targetkind, targetfile, opt) if implibfile then @@ -944,7 +951,7 @@ function link(self, objectfiles, targetkind, targetfile, flags, opt) end local program, argv = linkargv(self, objectfiles, targetkind, targetfile, flags, opt) - if option.get("verbose") then + if linker_output then os.execv(program, argv, {envs = self:runenvs(), shell = opt.shell}) else os.vrunv(program, argv, {envs = self:runenvs(), shell = opt.shell}) -- cgit v1.3.1