summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2026-03-10 00:52:32 +0800
committerruki <[email protected]>2026-03-10 00:52:32 +0800
commitdbd3e1a81718585105ed342ecc128df149590f70 (patch)
treeea03f47a403a0e51d60539017b311bd7adacc5fb /xmake/rules/c++/modules
parent1ec51411988ae0ca5adcaeeb383a107d305f9907 (diff)
show target name in progress
Diffstat (limited to 'xmake/rules/c++/modules')
-rw-r--r--xmake/rules/c++/modules/builder.lua14
-rw-r--r--xmake/rules/c++/modules/clang/scanner.lua2
-rw-r--r--xmake/rules/c++/modules/gcc/scanner.lua2
-rw-r--r--xmake/rules/c++/modules/msvc/scanner.lua2
-rw-r--r--xmake/rules/c++/modules/scanner.lua2
5 files changed, 14 insertions, 8 deletions
diff --git a/xmake/rules/c++/modules/builder.lua b/xmake/rules/c++/modules/builder.lua
index ae25d3063..761b2cf6c 100644
--- a/xmake/rules/c++/modules/builder.lua
+++ b/xmake/rules/c++/modules/builder.lua
@@ -254,6 +254,7 @@ function build_modules_for_jobgraph(target, jobgraph, built_modules)
local buildfilejob = _get_module_buildfilejob_for(target, sourcefile, moduletype)
table.insert(buildfilejobs, buildfilejob)
jobgraph:add(buildfilejob, function(_, _, jobopt)
+ progress.set_target(jobopt.progress, target)
-- build bmi if named job
jobopt.bmi = module.name
-- build objectfile here if two phase compilation is not supported
@@ -308,6 +309,7 @@ function build_objectfiles_for_jobgraph(target, jobgraph, built_modules)
local module = mapper.get(target, sourcefile)
local buildfilejob = _get_module_buildfilejob_for(target, sourcefile, "objectfile")
jobgraph:add(buildfilejob, function(_, _, jobopt)
+ progress.set_target(jobopt.progress, target)
jobopt.bmi = false
jobopt.objectfile = true
builder.make_module_job(target, module, jobopt)
@@ -498,6 +500,7 @@ function build_headerunits_for_jobgraph(target, jobgraph, built_stlheaderunits,
local buildfilejob = _get_headerunit_buildfilejob_for(_target, headerunit.sourcefile .. headerunit.key)
if not jobgraph:has(buildfilejob) then
jobgraph:add(buildfilejob, function(_, _, jobopt)
+ progress.set_target(jobopt.progress, _target)
builder.make_headerunit_job(_target, headerunit, table.join(jobopt, opt))
end)
end
@@ -606,9 +609,10 @@ function generate_metadata(target, modules)
local jobs = option.get("jobs") or os.default_njob()
runjobs(target:fullname() .. "_install_modules", function(index, _, jobopt)
+ progress.set_target(jobopt.progress, target)
local module = public_modules[index]
local metafilepath = support.get_metafile(target, module)
- progress.show(jobopt.progress, "${color.build.target}<%s> generating.module.metadata %s", target:fullname(), module.name)
+ progress.show(jobopt.progress, "${color.build.target}generating.module.metadata %s", module.name)
local metadata = _generate_meta_module_info(target, module)
json.savefile(metafilepath, metadata)
end, {comax = jobs, total = #public_modules})
@@ -653,15 +657,15 @@ function show_progress(target, module, opt)
if option.get("verbose") then
dim = "${dim}"
end
- local header = "${clear}${color.build.target}<%s>${clear}" .. dim
+ local header = "${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)
+ show(header .. "compiling.headerunit.$(mode) %s${clear}%s" .. suffix, name, cmd)
elseif opt.bmi then
if opt.objectfile then
- show(header .. " compiling.module.$(mode) %s${clear}%s" .. suffix, target:fullname(), module.name, cmd)
+ show(header .. "compiling.module.$(mode) %s${clear}%s" .. suffix, module.name, cmd)
else
- show(header .. " compiling.module.bmi.$(mode) %s${clear}%s" .. suffix, target:fullname(), module.name, cmd)
+ show(header .. "compiling.module.bmi.$(mode) %s${clear}%s" .. suffix, module.name, cmd)
end
else
show("compiling.$(mode) %s${clear}%s" .. suffix, module.sourcefile, cmd)
diff --git a/xmake/rules/c++/modules/clang/scanner.lua b/xmake/rules/c++/modules/clang/scanner.lua
index 96aa6a7e2..d73c40621 100644
--- a/xmake/rules/c++/modules/clang/scanner.lua
+++ b/xmake/rules/c++/modules/clang/scanner.lua
@@ -37,7 +37,7 @@ function scan_dependency_for(target, sourcefile, rescan, opt)
depend.on_changed(function()
if opt.progress and not os.getenv("XMAKE_IN_COMPILE_COMMANDS_PROJECT_GENERATOR") then
- progress.show(opt.progress, "${clear}${color.build.target}<%s> generating.module.deps %s", target:fullname(), sourcefile)
+ progress.show(opt.progress, "${clear}generating.module.deps %s", sourcefile)
end
local outputdir = support.get_outputdir(target, sourcefile, {scan = true})
diff --git a/xmake/rules/c++/modules/gcc/scanner.lua b/xmake/rules/c++/modules/gcc/scanner.lua
index b0cdda7af..fea1cec99 100644
--- a/xmake/rules/c++/modules/gcc/scanner.lua
+++ b/xmake/rules/c++/modules/gcc/scanner.lua
@@ -44,7 +44,7 @@ function scan_dependency_for(target, sourcefile, rescan, opt)
depend.on_changed(function()
if opt.progress and not os.getenv("XMAKE_IN_COMPILE_COMMANDS_PROJECT_GENERATOR") then
- progress.show(opt.progress, "${clear}${color.build.target}<%s> scanning.module.deps %s", target:fullname(), sourcefile)
+ progress.show(opt.progress, "${clear}scanning.module.deps %s", sourcefile)
end
local outputdir = support.get_outputdir(target, sourcefile, {scan = true})
diff --git a/xmake/rules/c++/modules/msvc/scanner.lua b/xmake/rules/c++/modules/msvc/scanner.lua
index 07f7de41e..bc7d7b1da 100644
--- a/xmake/rules/c++/modules/msvc/scanner.lua
+++ b/xmake/rules/c++/modules/msvc/scanner.lua
@@ -45,7 +45,7 @@ function scan_dependency_for(target, sourcefile, rescan, opt)
depend.on_changed(function ()
if opt.progress and not os.getenv("XMAKE_IN_COMPILE_COMMANDS_PROJECT_GENERATOR") then
- progress.show(opt.progress, "${clear}${color.build.target}<%s> generating.module.deps %s", target:fullname(), sourcefile)
+ progress.show(opt.progress, "${clear}generating.module.deps %s", sourcefile)
end
local outputdir = support.get_outputdir(target, sourcefile, {scan = true})
diff --git a/xmake/rules/c++/modules/scanner.lua b/xmake/rules/c++/modules/scanner.lua
index 8d5fd057d..2bcee1f12 100644
--- a/xmake/rules/c++/modules/scanner.lua
+++ b/xmake/rules/c++/modules/scanner.lua
@@ -27,6 +27,7 @@ import("core.base.profiler")
import("core.base.bytes")
import("async.jobgraph")
import("async.runjobs")
+import("utils.progress")
import("support")
import("mapper")
import("stlheaders")
@@ -538,6 +539,7 @@ function _schedule_module_dependencies_scan(target, jobgraph, sourcebatch)
if not jobgraph:has(scanfilejob) then
has_scanjob = true
jobgraph:add(scanfilejob, function(_, _, opt)
+ progress.set_target(opt.progress, target)
_do_scan(target, sourcefile, opt)
end)
end