summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/gcc.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/modules/core/tools/gcc.lua')
-rw-r--r--xmake/modules/core/tools/gcc.lua9
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})