diff options
| author | ruki <[email protected]> | 2026-01-13 22:34:19 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-01-13 22:34:19 +0800 |
| commit | a07a54f06c1341f9082b967d0c8205b214cc04e3 (patch) | |
| tree | 2c254456ca540468b44231af8500c5b24360aa84 /xmake/modules/core/tools/gcc.lua | |
| parent | 08bc9d63514a9eb28401aef5726ab9870c6b270e (diff) | |
improve nvcc warningscl
Diffstat (limited to 'xmake/modules/core/tools/gcc.lua')
| -rw-r--r-- | xmake/modules/core/tools/gcc.lua | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index c1a98b752..6fc7a641b 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -912,6 +912,18 @@ function add_sourceflags(self, sourcefile, fileconfig, target, targetkind) end end +-- show warnings +function _show_warnings(self, output) + local lines = output:split('\n', {plain = true}) + if #lines > 0 then + if not option.get("diagnosis") then + lines = table.slice(lines, 1, (#lines > 16 and 16 or #lines)) + end + local warnings = table.concat(lines, "\n") + progress.show_output("${color.warning}%s", warnings) + end +end + -- make the link arguments list function linkargv(self, objectfiles, targetkind, targetfile, flags, opt) @@ -1064,14 +1076,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt) function (ok, outdata, errdata) -- show warnings? if ok and errdata and #errdata > 0 and policy.build_warnings(opt) then - local lines = errdata:split('\n', {plain = true}) - if #lines > 0 then - if not option.get("diagnosis") then - lines = table.slice(lines, 1, (#lines > 16 and 16 or #lines)) - end - local warnings = table.concat(lines, "\n") - progress.show_output("${color.warning}%s", warnings) - end + _show_warnings(self, errdata) end -- generate the dependent includes |
