diff options
| author | ruki <[email protected]> | 2025-09-06 22:48:26 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-09-06 22:48:26 +0800 |
| commit | e2cd53a8bc9593c20aeb5c77a4a02fc38585f91e (patch) | |
| tree | 812ead23123a69c2d5bd488f40078dcdf747ed3e /xmake/modules | |
| parent | 8d003d54d21714a893990e640ab6d9e711a092a5 (diff) | |
| parent | e515d5bcc23ee9b8dda615540a77fd291c2b52ee (diff) | |
Merge pull request #6778 from xmake-io/compout
add build.linker.output
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/core/tools/gcc.lua | 9 |
1 files changed, 8 insertions, 1 deletions
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}) |
