diff options
| author | ruki <[email protected]> | 2025-11-21 22:54:29 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-11-21 22:54:29 +0800 |
| commit | 0719de2b664bdfc82ce30534ed196bfc81fc072a (patch) | |
| tree | 653d98166d0cf47bbe48859a91eb6c2c1bb1af32 /xmake/modules | |
| parent | 35bc14eee3c7568bc45591b435fce4d70c28dca9 (diff) | |
fix progress output
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/core/tools/clang_cl.lua | 3 | ||||
| -rw-r--r-- | xmake/modules/core/tools/cparser.lua | 3 | ||||
| -rw-r--r-- | xmake/modules/core/tools/llvm_rc.lua | 3 | ||||
| -rw-r--r-- | xmake/modules/core/tools/nasm.lua | 3 | ||||
| -rw-r--r-- | xmake/modules/core/tools/rc.lua | 6 | ||||
| -rw-r--r-- | xmake/modules/core/tools/tcc.lua | 3 | ||||
| -rw-r--r-- | xmake/modules/core/tools/windres.lua | 3 | ||||
| -rw-r--r-- | xmake/modules/core/tools/yasm.lua | 3 |
8 files changed, 18 insertions, 9 deletions
diff --git a/xmake/modules/core/tools/clang_cl.lua b/xmake/modules/core/tools/clang_cl.lua index d3c530c75..bafbc58a7 100644 --- a/xmake/modules/core/tools/clang_cl.lua +++ b/xmake/modules/core/tools/clang_cl.lua @@ -24,6 +24,7 @@ import("core.base.option") import("core.base.tty") import("core.base.colors") import("core.project.policy") +import("utils.progress") -- init it function init(self) @@ -207,7 +208,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt) local lines = errdata:split('\n', {plain = true}) if #lines > 0 then local warnings = table.concat(table.slice(lines, 1, (#lines > 8 and 8 or #lines)), "\n") - cprint("${color.warning}%s", warnings) + progress.show_output("${color.warning}%s", warnings) end end end diff --git a/xmake/modules/core/tools/cparser.lua b/xmake/modules/core/tools/cparser.lua index 6778a1a53..c9f12a821 100644 --- a/xmake/modules/core/tools/cparser.lua +++ b/xmake/modules/core/tools/cparser.lua @@ -24,6 +24,7 @@ import("core.project.config") import("core.project.project") import("core.project.policy") import("core.language.language") +import("utils.progress") -- init it function init(self) @@ -200,7 +201,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt) -- print some warnings if warnings and #warnings > 0 and policy.build_warnings(opt) then - cprint("${color.warning}%s", table.concat(table.slice(warnings:split('\n'), 1, 8), '\n')) + progress.show_output("${color.warning}%s", table.concat(table.slice(warnings:split('\n'), 1, 8), '\n')) end end } diff --git a/xmake/modules/core/tools/llvm_rc.lua b/xmake/modules/core/tools/llvm_rc.lua index b29d1e1be..efb5f0fdd 100644 --- a/xmake/modules/core/tools/llvm_rc.lua +++ b/xmake/modules/core/tools/llvm_rc.lua @@ -23,6 +23,7 @@ import("core.base.option") import("core.base.global") import("core.project.policy") import("core.project.project") +import("utils.progress") -- init it function init(self) @@ -80,7 +81,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt) -- print some warnings if warnings and #warnings > 0 and policy.build_warnings(opt) then - cprint("${color.warning}%s", table.concat(table.slice(warnings:split('\n'), 1, 8), '\n')) + progress.show_output("${color.warning}%s", table.concat(table.slice(warnings:split('\n'), 1, 8), '\n')) end end } diff --git a/xmake/modules/core/tools/nasm.lua b/xmake/modules/core/tools/nasm.lua index a7ea1552d..b20678ff6 100644 --- a/xmake/modules/core/tools/nasm.lua +++ b/xmake/modules/core/tools/nasm.lua @@ -22,6 +22,7 @@ import("core.base.option") import("core.project.policy") import("core.language.language") +import("utils.progress") -- init it function init(self) @@ -123,7 +124,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt) if ok and errdata and policy.build_warnings(opt) then errdata = errdata:trim() if #errdata > 0 then - cprint("${color.warning}%s", errdata) + progress.show_output("${color.warning}%s", errdata) end end end diff --git a/xmake/modules/core/tools/rc.lua b/xmake/modules/core/tools/rc.lua index 6eec87557..a282eea22 100644 --- a/xmake/modules/core/tools/rc.lua +++ b/xmake/modules/core/tools/rc.lua @@ -22,7 +22,9 @@ import("core.base.option") import("core.base.hashset") import("core.project.project") +import("core.project.policy") import("private.tools.vstool") +import("utils.progress") -- normailize path of a dependecy function _normailize_dep(dep, projectdir) @@ -113,8 +115,8 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt) finally { function (ok, warnings) - if warnings and #warnings > 0 and option.get("verbose") then - cprint("${color.warning}%s", table.concat(table.slice(warnings:split('\n'), 1, 8), '\n')) + if warnings and #warnings > 0 and policy.build_warnings(opt) then + progress.show_output("${color.warning}%s", table.concat(table.slice(warnings:split('\n'), 1, 8), '\n')) end end } diff --git a/xmake/modules/core/tools/tcc.lua b/xmake/modules/core/tools/tcc.lua index 9eb9294ac..5b65d6675 100644 --- a/xmake/modules/core/tools/tcc.lua +++ b/xmake/modules/core/tools/tcc.lua @@ -25,6 +25,7 @@ import("core.project.config") import("core.project.project") import("core.project.policy") import("core.language.language") +import("utils.progress") -- init it function init(self) @@ -195,7 +196,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt) -- print some warnings if warnings and #warnings > 0 and policy.build_warnings(opt) then - cprint("${color.warning}%s", table.concat(table.slice(warnings:split('\n'), 1, 8), '\n')) + progress.show_output("${color.warning}%s", table.concat(table.slice(warnings:split('\n'), 1, 8), '\n')) end -- generate the dependent includes diff --git a/xmake/modules/core/tools/windres.lua b/xmake/modules/core/tools/windres.lua index 1e651596b..c394c3c68 100644 --- a/xmake/modules/core/tools/windres.lua +++ b/xmake/modules/core/tools/windres.lua @@ -23,6 +23,7 @@ import("core.base.option") import("core.base.global") import("core.project.policy") import("core.project.project") +import("utils.progress") -- init it function init(self) @@ -74,7 +75,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt) { function (ok, warnings) if warnings and #warnings > 0 and policy.build_warnings(opt) then - cprint("${color.warning}%s", table.concat(table.slice(warnings:split('\n'), 1, 8), '\n')) + progress.show_output("${color.warning}%s", table.concat(table.slice(warnings:split('\n'), 1, 8), '\n')) end end } diff --git a/xmake/modules/core/tools/yasm.lua b/xmake/modules/core/tools/yasm.lua index 056779712..80aa283c6 100644 --- a/xmake/modules/core/tools/yasm.lua +++ b/xmake/modules/core/tools/yasm.lua @@ -22,6 +22,7 @@ import("core.base.option") import("core.project.policy") import("core.language.language") +import("utils.progress") -- init it function init(self) @@ -111,7 +112,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt) if ok and errdata and policy.build_warnings(opt) then errdata = errdata:trim() if #errdata > 0 then - cprint("${color.warning}%s", errdata) + progress.show_output("${color.warning}%s", errdata) end end end |
