summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/builder.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-05-12 14:30:44 +0800
committerGitHub <[email protected]>2025-05-12 14:30:44 +0800
commit9ecfe9b05e0891ea06f834b8ca75f2433504ce31 (patch)
tree0acdbb0991ccb32cecc11160bd8d06bf0f5b9e74 /xmake/rules/c++/modules/builder.lua
parent5a580f088db2e75271f133e68d549102fa334486 (diff)
parent3ba28a72239a8d23d13cd577437e871eaebc155a (diff)
Merge pull request #6423 from Arthapz/improve-module-format-output
(C++ modules support) Improve module format output
Diffstat (limited to 'xmake/rules/c++/modules/builder.lua')
-rw-r--r--xmake/rules/c++/modules/builder.lua30
1 files changed, 30 insertions, 0 deletions
diff --git a/xmake/rules/c++/modules/builder.lua b/xmake/rules/c++/modules/builder.lua
index 9a5a4b37e..44da4d622 100644
--- a/xmake/rules/c++/modules/builder.lua
+++ b/xmake/rules/c++/modules/builder.lua
@@ -594,6 +594,36 @@ function is_dependencies_changed(target, module)
return requires, changed
end
+function show_progress(target, module, opt)
+ local show = function(...)
+ local batchcmds = opt and opt.batchcmds
+ if batchcmds then
+ batchcmds:show_progress(opt.progress, ...)
+ else
+ progress.show(opt.progress, ...)
+ end
+ end
+ local suffix = opt.suffix or ""
+ local cmd = opt.cmd or ""
+ local dim = ""
+ if option.get("verbose") then
+ dim = "${dim}"
+ end
+ local header = "${clear}${color.build.target}<%s>${clear}" .. dim
+ if opt.headerunit then
+ local name = module.method == "include-angle" and ("<" .. path.filename(module.name) .. ">") or module.name
+ show(header .. " compiling.headerunit.$(mode) %s${clear}%s" .. suffix, target:fullname(), name, cmd)
+ elseif opt.bmi then
+ if opt.objectfile then
+ show(header .. " compiling.module.$(mode) %s${clear}%s" .. suffix, target:fullname(), module.name, cmd)
+ else
+ show(header .. " compiling.module.bmi.$(mode) %s${clear}%s" .. suffix, target:fullname(), module.name, cmd)
+ end
+ else
+ show("compiling.$(mode) %s${clear}%s" .. suffix, module.sourcefile, cmd)
+ end
+end
+
function clean(target)
-- we cannot use target:data("cxx.has_modules"),
-- because on_config will be not called when cleaning targets