diff options
| author | ruki <[email protected]> | 2025-09-06 19:58:47 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-09-06 19:58:47 +0800 |
| commit | e515d5bcc23ee9b8dda615540a77fd291c2b52ee (patch) | |
| tree | b2d7fcc1553fd244f1ddb1545e34aa80c6385fea /xmake/modules/core/tools/gcc.lua | |
| parent | 31d2273f44022b19870f2a0f05f644ffd56bb6b5 (diff) | |
add build.linker.output
Diffstat (limited to 'xmake/modules/core/tools/gcc.lua')
| -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}) |
